2017-07-09 21:05:59 +03:00
|
|
|
MALObject subclass: Func [
|
|
|
|
| ast params env fn isMacro |
|
2017-07-06 23:54:34 +03:00
|
|
|
|
|
|
|
ast [ ^ast ]
|
|
|
|
params [ ^params ]
|
|
|
|
env [ ^env ]
|
|
|
|
fn [ ^fn ]
|
2017-07-08 20:49:09 +03:00
|
|
|
isMacro [ ^isMacro ]
|
2017-07-07 19:36:48 +03:00
|
|
|
|
2017-07-08 20:49:09 +03:00
|
|
|
isMacro: bool [
|
|
|
|
isMacro := bool
|
|
|
|
]
|
|
|
|
|
2017-07-06 23:54:34 +03:00
|
|
|
Func class >> new: ast params: params env: env fn: fn [
|
|
|
|
| func |
|
2017-07-09 21:05:59 +03:00
|
|
|
func := super new: #func value: fn meta: nil.
|
2017-07-06 23:54:34 +03:00
|
|
|
func init: ast params: params env: env fn: fn.
|
|
|
|
^func
|
|
|
|
]
|
|
|
|
|
|
|
|
init: anAst params: someParams env: anEnv fn: aFn [
|
|
|
|
ast := anAst.
|
|
|
|
params := someParams.
|
|
|
|
env := anEnv.
|
|
|
|
fn := aFn.
|
2017-07-08 20:49:09 +03:00
|
|
|
isMacro := false
|
2017-07-06 23:54:34 +03:00
|
|
|
]
|
|
|
|
]
|