mirror of
https://github.com/russolsen/sallyforth
synced 2024-12-26 21:58:32 +01:00
Set *source* during init.
This commit is contained in:
parent
f1bdf52b2b
commit
965f78f142
1 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,7 @@ class Forth:
|
||||||
initial_defs = {
|
initial_defs = {
|
||||||
'*prompt*': const_f('SallyForth>> '),
|
'*prompt*': const_f('SallyForth>> '),
|
||||||
'macroexpand': w_enlist,
|
'macroexpand': w_enlist,
|
||||||
|
'*source*': const_f(__file__),
|
||||||
'true': const_f(True),
|
'true': const_f(True),
|
||||||
'false': const_f(False),
|
'false': const_f(False),
|
||||||
'nil': const_f(None),
|
'nil': const_f(None),
|
||||||
|
@ -149,6 +150,7 @@ class Forth:
|
||||||
return
|
return
|
||||||
|
|
||||||
if token in self.namespace:
|
if token in self.namespace:
|
||||||
|
# print("executing ", token)
|
||||||
self.namespace[token](self, 0)
|
self.namespace[token](self, 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue