mirror of
https://github.com/flynx/Slang.git
synced 2025-10-29 10:40:07 +00:00
minor changes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e26277e6b7
commit
94c0c47c0f
@ -564,16 +564,17 @@ var BOOTSTRAP = [
|
||||
':: inc ( a -- b ) [ 1 add ]',
|
||||
':: dec ( a -- b ) [ 1 sub ]',
|
||||
'',
|
||||
'-- experimental...',
|
||||
'-- NOTE: these are at this point stupid and do not support priorities or grouping...',
|
||||
'-- NOTE: these have both stack and code effect, in genera the operations are of ',
|
||||
'-- the form: A op B',
|
||||
'',
|
||||
'-- Meta-word examples (experimental)...',
|
||||
'',
|
||||
'-- Here is an infix operator example...',
|
||||
'-- :: + ( a | b -- c | ) [ \\ exec 2 0 _swapN \\ exec \\ add 2 1 _swapN ]',
|
||||
'-- now let\'s make a meta function to make things shorter...',
|
||||
'-- first the helper...'
|
||||
':: _infix ( op word -- ) [',
|
||||
' -- format the word definition...',
|
||||
' s2b \\ :: -3 before b2s',
|
||||
'',
|
||||
' -- our template...',
|
||||
' -- exec the left side...',
|
||||
' [ \\ exec 2 0 _swapN',
|
||||
@ -581,12 +582,15 @@ var BOOTSTRAP = [
|
||||
' \\ exec \\ WORD 2 1 _swapN ] clone',
|
||||
' -- replace WORD with the actual target word...',
|
||||
' swap 8 to',
|
||||
'',
|
||||
' -- push to code / run',
|
||||
' 3 0 _swapN ]',
|
||||
'',
|
||||
'-- formatter for the _infix word...',
|
||||
':: infix: ( | op word -- | ) [ \\ _infix 1 2 _swapN ]',
|
||||
'',
|
||||
'-- Now making a word/2 an infix operator is trivial...',
|
||||
'-- NOTE: these are at this point stupid and do not support priorities...',
|
||||
'infix: + add',
|
||||
'infix: - sub',
|
||||
'infix: * mul',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user