Commit Graph

20 Commits

Author SHA1 Message Date
James Strachan 9523be50de added not null helper methods for Set and Map 2012-02-24 17:25:59 +00:00
James Strachan cb7d23c420 added collection.toSortedSet() for easier conversion to sorted setsand collection.notNull() so its easy to treat a nullable collection/list as a collection 2012-02-24 07:04:47 +00:00
James Strachan a68b00dfd4 renamed the rather long getOrElseUpdate to a simpler getOrPut which is a bit simpler and more accurate; as a new entry is put into the Map if its null 2012-02-21 11:29:50 +00:00
James Strachan 724f7860ab tried moving helper function to where the other global util functions are defined to try avoid namespace method disappearing 2012-02-21 11:29:50 +00:00
Alex Tkachman 897f3dc799 KT-923 Collection.indices property 2012-01-08 13:24:14 +02:00
James Strachan 8396017b5b added example of compiler issue; unable to create 'size' and 'empty' properties on Collection<T> and java.util.Map<T> it seems? wonder if its a qualified name issue - qualified names don't seem to be allowed on extension properties - will raise an issue... 2011-12-23 17:20:25 +00:00
James Strachan 5242985e2e first cut of a little bit of code generation to make sure we mirror most of the java.util.Iterable<T> methods to Array<T> 2011-12-23 15:23:21 +00:00
James Strachan 894c84190a migrated most of the test cases over to the new -> syntax for functions; still can't compile or run the tests yet though :(, needs more work... 2011-12-21 16:26:37 +00:00
Andrey Breslav 6aad3b2662 GreatSyntacticShift: Codegen testdata fixed 2011-12-20 22:56:13 +04:00
James Strachan c9959a10f9 added a couple of helper methods to Map to be able look up in a Map with function to provide a default value 2011-12-20 18:06:58 +00:00
James Strachan 212160fa47 added Array<T>.to(collection) too, along with simpler more DRY one liners for arrayList(), linkedList() and hashSet() helper functions 2011-12-20 17:46:26 +00:00
James Strachan de4b0a4601 added Alex's to(collection: Collection<T>) helper method and simple 1 liners for toList / toLinkedList / toSet etc 2011-12-20 17:27:22 +00:00
James Strachan 68d527c839 removed some warnings and reduntant code 2011-12-20 17:02:30 +00:00
James Strachan fee6bed2d4 removed the create() methods; added linkedList<T>(varargs) helper method and made filter/flatMap/map all allow an optional argument for the kind of collection to filter/flatMap/map into. I've temporarily commented out Alex's implementation of Iterable.filter in Filters.kt as I was getting all kinds of compile error messages. Will discuss this on the list & how better to organise the functions into files 2011-12-20 16:28:18 +00:00
Alex Tkachman d37c6976b1 methods for iterators and filters 2011-12-20 15:56:10 +02:00
James Strachan 7e93494e2f renamed the sort() methods on Iterable which create a new List and sort that as "toSortedList()" instead which is more accurate. 2011-12-18 08:15:39 +00:00
James Strachan d122929b4b first cut of the collection methods in the standard library in http://confluence.jetbrains.net/display/JET/Standard+Library along with a little testlib to test them. Still a few TODO things and tidy up (and am sure a few more methods could be very handy too) but its getting Kool :) 2011-12-18 07:17:38 +00:00
James Strachan 55ba7c0fde added a first spike of the collection-like methods based on this doc http://confluence.jetbrains.net/display/JET/Standard+Library 2011-12-16 11:29:11 +00:00
Alex Tkachman 9d0a2c7243 (slightly modified) contribution of Sergey Ignatov of methods for strings and arrays 2011-12-13 13:26:42 +02:00
Alex Tkachman b9f39b00c0 KotlinCompiler and tests aware on standard library 2011-11-28 14:36:57 +02:00