Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- value index :a # store `value' in array linked to top of stack `a', with index `index'
- index ;a # push a[index] on (main) stack
- [z 1- :a z 0 !=F]dsFx # or I could just write such a function for you :)
- [ # Everything is wrapped in one big macro
- [ # An inner macro for our *then* part
- # <-- Stuff to execute if a==b here
- 2Q # Then quit the inner and outer macro
- ]sE # `E' is for Execution register ;)
- la lb =E # if a==b, execute E
- # if E is executed, it will quit the whole macro, so the rest is never reached:
- # <-- Stuff to execute if a!=b here
- ]x # End macro; Execute
- [[(then)2Q]sE(condition)E(else)]x
- A == B ? C : D;
- 0AB-^E*C+
- _3 # pushes -3
- _ # pushes 0...sometimes
- c4 5_6 # -6,5,4
- c4 5_ 6 # -6,5,4
- c4 5_
- 6 # -6,5,4 # still a negative sign since the next thing it sees is a digit
- c4 5_z # 3,0,4,5 # if it's followed by a non-digit, it's a 0
- c4 5_p6 # 6,0,5,4
- c4 _* # 0 # 4*0=0
Add Comment
Please, Sign In to add comment