mirror of
https://github.com/russolsen/sallyforth
synced 2024-11-16 19:48:49 +01:00
Add timing words, improve keyword display.
This commit is contained in:
parent
47554de9f4
commit
480f6df6a5
2 changed files with 10 additions and 1 deletions
|
@ -83,6 +83,7 @@ unique 'map-marker =!
|
|||
: callable? { builtins/callable !!1 }
|
||||
: sleep { time/sleep !!1 drop }
|
||||
: ctime { time/ctime !!0 }
|
||||
: now { time/time !!0 }
|
||||
|
||||
/ Set the interactive prompt.
|
||||
|
||||
|
@ -114,8 +115,13 @@ unique 'map-marker =!
|
|||
ns? not ifelse { "Namespace " . . " not loaded." p }
|
||||
{ "Namespace " . . " loaded." p }
|
||||
}
|
||||
|
||||
/ Time execution
|
||||
|
||||
: time[ { now }
|
||||
: ]time { now swap - }
|
||||
|
||||
/ Documentartion
|
||||
/ Documentation
|
||||
|
||||
: ->doc { *last-word* setdoc }
|
||||
: __doc__ { <. $? '__doc__ .> }
|
||||
|
|
|
@ -16,3 +16,6 @@ class Keyword(UserString):
|
|||
|
||||
def __repr__(self):
|
||||
return ':' + str(self)
|
||||
|
||||
def __str__(self):
|
||||
return ':' + self.data
|
||||
|
|
Loading…
Reference in a new issue