Changes between Version 1 and Version 2 of AnonMethod
- Timestamp:
- 11/22/10 18:38:15 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AnonMethod
v1 v2 17 17 Anonymous Method 18 18 {{{ 19 #!cobra 19 20 do [as <Type>] # no parameters 20 21 <body statements...> … … 30 31 Lambdas 31 32 {{{ 33 #!cobra 32 34 do = <expr> # no parameters 33 35 do (<paramList>) = <expr> # args passed as per invocation … … 38 40 Anonymous Method 39 41 {{{ 42 #!cobra 40 43 sig ArithmeticOp(a as int, b as int) as int 41 44 sig SimpleMethod … … 78 81 Lambda 79 82 {{{ 83 #!cobra 80 84 t = [3, 2, 1] 81 85 t.sort(do(a as int, b as int)=a.compareTo(b)) … … 92 96 e.g 93 97 {{{ 98 #!cobra 94 99 class Test 95 100