mirror of
https://github.com/flynx/Course-JavaScript.git
synced 2025-10-30 11:30:07 +00:00
fixed some minor bugs + some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
01a0b7872a
commit
2596b93e84
@ -365,7 +365,7 @@ var NAMESPACE = {
|
|||||||
return context.stack.pop() * context.stack.pop()
|
return context.stack.pop() * context.stack.pop()
|
||||||
},
|
},
|
||||||
'div': function(context){
|
'div': function(context){
|
||||||
return context.stack.pop() / context.stack.pop()
|
return 1/context.stack.pop() * context.stack.pop()
|
||||||
},
|
},
|
||||||
|
|
||||||
// block/list operations...
|
// block/list operations...
|
||||||
@ -709,13 +709,12 @@ var BOOTSTRAP = [
|
|||||||
' -- empty list, sum is 0...',
|
' -- empty list, sum is 0...',
|
||||||
' [ len 0 eq ] ?',
|
' [ len 0 eq ] ?',
|
||||||
' [ . 0 ]',
|
' [ . 0 ]',
|
||||||
|
' -- sum of list of len 1 is it\'s content, so just pop it...',
|
||||||
|
' else [ [ len 1 eq ] ?',
|
||||||
|
' [ pop swap . ]',
|
||||||
|
' -- and now recursively sum up elements till the list is 1 in length...',
|
||||||
' else',
|
' else',
|
||||||
' -- sum of list of len 1 is it\'s content, so just pop it...',
|
' [ pop rot pop tor add push sum ] ] ]',
|
||||||
' [ [ len 1 eq ] ?',
|
|
||||||
' [ pop swap . ]',
|
|
||||||
' -- and now recursively sum up elements till the list is 1 in length...',
|
|
||||||
' else',
|
|
||||||
' [ pop rot pop tor add push sum ] ] ]',
|
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
@ -728,7 +727,7 @@ var BOOTSTRAP = [
|
|||||||
' [',
|
' [',
|
||||||
' -- format the word definition...',
|
' -- format the word definition...',
|
||||||
' -- NAME WORD -> :: NAME WORD',
|
' -- NAME WORD -> :: NAME WORD',
|
||||||
' s2b \\ :: -3 before b2s',
|
' s2b \\ :: -2 before b2s',
|
||||||
'',
|
'',
|
||||||
' -- our template...',
|
' -- our template...',
|
||||||
' -- exec the left side...',
|
' -- exec the left side...',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user