Water 5-Method and Class-MethodContract| Return type | wob | | Parameter key | Default value | Type | | include | return_true | var | | limit | opt | | include_limit | true | boolean | | Parameter kind | Default value | Type | | Other unkeyed arguments | opt with ekind of expression | wob | | Other keyed arguments | opt | | Water Contract<method method.copy
include =return_true
limit =opt
include_limit=true
_other_keyed =opt=wob=ekind.code="_add_to_environment"
_other_unkeyed=opt=wob=ekind.expression="_body"/> | |
Creates (and returns) a new method that is the same as the _subject method.
The new implementation should be put in the content of call to copy.
It is common to use set immediately after copy to change
or add additional fields.
<method foo bar=required> bar </>
<set new_foo = foo.<copy/>.<set bar=20/> />
<new_foo/>
 | 20 |
Copying a method and changing its arguments is also known as currying.
<method foo bar=10>
"hello".<join bar/>
</>
<foo/>
 | "hello10" |
<foo.<copy/>.<set bar=20 baz="aaa"/>/>
 | "hello20" |
<foo.<copy> "bye" </> />
"bye" <foo/>
"hello10" <method foo bar=10> "hello".<join bar/> </method>.
<copy/>.<set bar=20/>
 | <method _name_argument=foo_copy bar=20 "hello".<join bar/>/>
|
© Copyright 2007 Clear Methods, Inc.