September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,33 +1,25 @@
|
|||
#define system.
|
||||
#define extensions.
|
||||
import extensions.
|
||||
|
||||
#class Extender :: BaseExtender
|
||||
class Extender :: BaseExtender
|
||||
{
|
||||
#field theField.
|
||||
object prop foo :: theField.
|
||||
|
||||
#constructor new : anObject
|
||||
constructor new : anObject
|
||||
[
|
||||
theObject := anObject.
|
||||
]
|
||||
|
||||
#method foo = theField.
|
||||
|
||||
#method set &foo : aValue
|
||||
[
|
||||
theField := aValue.
|
||||
]
|
||||
}
|
||||
|
||||
#symbol program =
|
||||
program =
|
||||
[
|
||||
#var anObject := 234.
|
||||
var anObject := 234.
|
||||
|
||||
// extending an object with a field
|
||||
anObject := Extender new:anObject.
|
||||
anObject := Extender new(anObject).
|
||||
|
||||
anObject set &foo:"bar".
|
||||
anObject foo := "bar".
|
||||
|
||||
console writeLine:anObject:".foo=":(anObject foo).
|
||||
console printLine(anObject,".foo=",anObject foo).
|
||||
|
||||
console readChar.
|
||||
].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue