@@ -382,9 +382,9 @@ Returns true if the stack has at least two items on it, false otherwise.
382382addF (" pop" ,
383383"""
384384'pop'
385- V ->
386- Discards a value V .
387- """ , @ [(" V " , tAny)]):
385+ X ->
386+ Discards a value X .
387+ """ , @ [(" X " , tAny)]):
388388 discard s.pop ()
389389
390390addF (" dup" ,
@@ -414,15 +414,15 @@ Positive R rotates to the right, negative R rotates to the left.
414414 var expe = newProcArgs (count)
415415
416416 for i in 0 ..< expe.len ():
417- expe[i] = (" I " & $ (i + 1 ), tAny)
417+ expe[i] = (" V " & $ (i + 1 ), tAny)
418418
419419 s.check (expe)
420420
421421 let st = s.stack ()
422422
423423 var sl = st[st.len () - count .. ^ 1 ]
424424
425- sl.rotateLeft (- roll)
425+ sl.rotateLeft (roll)
426426
427427 var j = 0
428428
@@ -441,19 +441,34 @@ Exchanges the positions of values X and Y.
441441addS (" rot" ,
442442"""
443443'rot'
444- X Y Z -> Y Z X
445- Rotates the top three values on the stack to the left .
444+ X Y Z -> Z X Y
445+ Rotates the top three values on the stack to the right .
446446""" , @ [(" X" , tAny), (" Y" , tAny), (" Z" , tAny)]):
447447 " 3 1 roll"
448448
449449addS (" -rot" ,
450450"""
451451'-rot'
452- X Y Z -> Z X Y
453- Rotates the top three values on the stack to the right .
452+ X Y Z -> Y Z X
453+ Rotates the top three values on the stack to the left .
454454""" , @ [(" X" , tAny), (" Y" , tAny), (" Z" , tAny)]):
455455 " 3 -1 roll"
456456
457+ addS (" nip" ,
458+ """
459+ 'nip'
460+ X Y -> Y
461+ Discards the second-from-top value on the stack.
462+ """ , @ [(" X" , tAny), (" Y" , tAny)]):
463+ " exch pop"
464+
465+ addS (" over" ,
466+ """
467+ 'over'
468+ X Y -> X Y X
469+ Discards the second-from-top value to the top of the stack.
470+ """ , @ [(" X" , tAny), (" Y" , tAny)]):
471+ " exch dup rot"
457472
458473# Arithmetic operators
459474
@@ -1243,7 +1258,7 @@ end"""
12431258addF (" symbols" ,
12441259"""
12451260'symbols'
1246- -> list< symbol>
1261+ -> list( symbol)
12471262Returns a list of the symbols inside the last opened dictionary.
12481263""" , @ []):
12491264 let symbols = s.symbols
@@ -1257,7 +1272,7 @@ Returns a list of the symbols inside the last opened dictionary.
12571272addF (" rsymbols" ,
12581273"""
12591274'rsymbols'
1260- -> list< list< symbol>>
1275+ -> list( list( symbol))
12611276Returns a list of lists of the symbols in each dictionary.
12621277""" , @ []):
12631278 let dicts = s.dicts
0 commit comments