@@ -766,3 +766,56 @@ fun <K, V> Map<K, V>.toPersistentHashMap(): PersistentMap<K, V>
766766        =  this  as ?  PersistentHashMap 
767767        ? :  (this  as ?  PersistentHashMapBuilder <K , V >)?.build()
768768        ? :  PersistentHashMap .emptyOf<K , V >().putAll(this )
769+ 
770+ /* *
771+  * Returns an immutable list using the given [builderAction] 
772+  * 
773+  * The list passed as a receiver to the [builderAction] is valid only inside that function. 
774+  * Using it outside the function produces an unspecified behavior. 
775+  */  
776+ inline  fun  <T > buildPersistentList (builderAction :  PersistentList .Builder <T >.() ->  Unit ): PersistentList <T > = 
777+         persistentListOf<T >().builder().apply (builderAction).build()
778+ 
779+ /* *
780+  * Returns an immutable set using the given [builderAction] 
781+  * 
782+  * The list passed as a receiver to the [builderAction] is valid only inside that function. 
783+  * Using it outside the function produces an unspecified behavior. 
784+  * 
785+  * Elements of the set are iterated in the order they were added by the [builderAction]. 
786+  */  
787+ inline  fun  <T > buildPersistentSet (builderAction :  PersistentSet .Builder <T >.() ->  Unit ): PersistentSet <T > = 
788+         persistentSetOf<T >().builder().apply (builderAction).build()
789+ 
790+ /* *
791+  * Returns an immutable hash set using the given [builderAction] 
792+  * 
793+  * The list passed as a receiver to the [builderAction] is valid only inside that function. 
794+  * Using it outside the function produces an unspecified behavior. 
795+  * 
796+  * Order of the elements in the returned set is unspecified. 
797+  */  
798+ inline  fun  <T > buildPersistentHashSet (builderAction :  PersistentSet .Builder <T >.() ->  Unit ): PersistentSet <T > = 
799+         persistentHashSetOf<T >().builder().apply (builderAction).build()
800+ 
801+ /* *
802+  * Returns an immutable map using the given [builderAction] 
803+  * 
804+  * The map passed as a receiver to the [builderAction] is valid only inside that function. 
805+  * Using it outside the function produces an unspecified behavior. 
806+  * 
807+  * Entries of the map are iterated in the order they were added by the [builderAction]. 
808+  */  
809+ inline  fun  <K , V > buildPersistentMap (builderAction :  PersistentMap .Builder <K , V >.() ->  Unit ): PersistentMap <K , V > = 
810+         persistentMapOf<K , V >().builder().apply (builderAction).build()
811+ 
812+ /* *
813+  * Returns an immutable hash map using the given [builderAction] 
814+  * 
815+  * The map passed as a receiver to the [builderAction] is valid only inside that function. 
816+  * Using it outside the function produces an unspecified behavior. 
817+  * 
818+  * Order of the entries in the returned map is unspecified. 
819+  */  
820+ inline  fun  <K , V > buildPersistentHashMap (builderAction :  PersistentMap .Builder <K , V >.() ->  Unit ): PersistentMap <K , V > = 
821+         persistentHashMapOf<K , V >().builder().apply (builderAction).build()
0 commit comments