smalltalk-tng
view r1/test.thing @ 321:c4a0718c2d3c
Sketch of dependencies
| author | Tony Garnock-Jones <tonygarnockjones@gmail.com> |
|---|---|
| date | Sat Oct 08 15:36:03 2011 -0400 (7 months ago) |
| parents | |
| children |
line source
1 "-*- slate -*-"
3 Namespaces addGlobal: #Counter value: (count:= Nil).
5 [ :a :b | c = a + b. c ].
7 [ :a :b | a + b ].
9 _@(Integer traits) ++ _@(Integer traits)
10 [
11 'ho ho ho'
12 ].
14 a@(Integer traits) plus: b@(Integer traits)
15 [
16 a + b
17 ].
19 c@Counter new
20 [
21 "a comment"
22 'a string'.
23 (c count:= 0 ref)
24 ].
26 c@Counter next
27 [
28 c count -> [ :value | c count <- value + 1 . value ]
29 ].
31 _@True ifTrue: block@(Block traits) [ block value ].
32 _@False ifTrue: block@(Block traits) [ False ].
33 _@True ifFalse: block@(Block traits) [ True ].
34 _@False ifFalse: block@(Block traits) [ block value ].
36 _@True ifTrue: b1@(Block traits) ifFalse: b2@(Block traits) [ b1 value ].
37 _@False ifTrue: b1@(Block traits) ifFalse: b2@(Block traits) [ b2 value ].
39 _@Integer trySomethingWith: other
40 [ results = Array with: 29 fib with: 30 fib with: 31 fib.
41 Console printLn: (results at: 0).
42 Console printLn: (results at: 1).
43 resend
44 ].
46 [ ctxt (
47 True ifTrue: [ ctxt return: 3 ].
48 (123 . 234 . 345)
49 )
50 ].
