Changes between Version 7 and Version 8 of StandardLibraryExtensionMethods
- Timestamp:
- 05/05/09 04:36:49 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StandardLibraryExtensionMethods
v7 v8 18 18 19 19 extend System.Object 20 21 def typeOf as System.Type 22 """ Using.typeOf is portable between platforms in contrast to CLR .getType and JVM .getClass. """ 23 return .getType 20 24 21 25 def toTechString as String … … 54 58 extend IList<of T> 55 59 60 def concated(other as IList<of T>?) as IList<of T> 61 """ 62 Returns a new list with the contents of this list and the other. 63 Does not modify this list or the other. 64 The returned list is the same class as the receiver. 65 Assumes the receiving type has an initializer that takes a `capacity as int`. 66 """ 67 56 68 def get(flexibleIndex as int) as T 57 69 require … … 80 92 """ 81 93 94 def numberedDown as KeyValuePair<of int, T>* 95 """ 96 Returns a stream of pairs of (index, value) in reverse order from 97 the end of the list down. 98 99 Can be used like so: 100 for i, value in someList.numberedDown 101 ... 102 """ 103 104 def random as T 105 require .count > 0 106 return .random(CobraCore.random) 107 108 def random(r as Random) as T 109 require .count > 0 110 return this[r.next % .count] 111 112 def removeLast 113 require .count > 0 114 ensure .count == old .count - 1 115 .removeAt(.count-1) 116 82 117 def reversed as List<of T> 83 118 ensure