annotate samples/sort.tp @ 331:61f5b794d939

Breaking change: method call syntax now always uses the syntactic receiver as the actual receiver. This makes its behavior different from function call syntax, but solves some problems with methods being shadowed by local variables and the like.
author Michael Pavone <pavone@retrodev.com>
date Sat, 28 Mar 2015 14:21:04 -0700
parents fb54a3af9c86
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
322
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #{
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 main <- {
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 a <- #[1 2 3 4 5 6 7 8 9]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 b <- #[9 8 7 6 5 4 3 2 1]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 c <- #[1 3 5 7 9 2 4 6 8 10]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6 d <- #[10 8 6 4 2 9 7 5 3 1]
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 a sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 print: (a join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 b sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 print: (b join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 c sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 print: (c join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 d sort
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 print: (d join: " ") . "\n"
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15 }
fb54a3af9c86 Add sort method to arrays
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16 }