annotate modules/option.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 38ca63e0a62e
children 1458c069c715
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
275
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 {
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 _none <- #{
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 value:none <- :ifval :ifnone {
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 ifnone:
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 }
290
38ca63e0a62e Added value? and none? methods to option value and option none
Michael Pavone <pavone@retrodev.com>
parents: 275
diff changeset
6 value? <- { false }
38ca63e0a62e Added value? and none? methods to option value and option none
Michael Pavone <pavone@retrodev.com>
parents: 275
diff changeset
7 none? <- { true }
275
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 }
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 #{
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 value <- :v {
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 #{
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 value:none <- :ifval :ifnone {
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 ifval: v
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 }
290
38ca63e0a62e Added value? and none? methods to option value and option none
Michael Pavone <pavone@retrodev.com>
parents: 275
diff changeset
15 value? <- { true }
38ca63e0a62e Added value? and none? methods to option value and option none
Michael Pavone <pavone@retrodev.com>
parents: 275
diff changeset
16 none? <- { false }
275
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 }
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 }
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 none <- { _none }
d83647152485 Added option module which was omitted in commit of SDL work
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20 }
290
38ca63e0a62e Added value? and none? methods to option value and option none
Michael Pavone <pavone@retrodev.com>
parents: 275
diff changeset
21 }