I'm collecting all the named stack combinators, if you know of some that are not in the list, or know alternate names for some of these, send them over with the name of the #concat language you found them in. Thank you!
I'm collecting all the named stack combinators, if you know of some that are not in the list, or know alternate names for some of these, send them over with the name of the #concat language you found them in. Thank you! 18 comments
@neauoire The only ones I've ever used are the Forth standards - DUP, DROP, SWAP, ROT, OVER - and the newer NIP, TUCK, PICK, ROLL and -ROT. >R and R> should be honourary members. π @AlgoCompSynth Forth doesn't have built-in quotes so that limits the operators a bit, but you're right maybe I should add the stack exchange operations since quotations are sometimes emulated via return stack stashing. @neauoire Return stack juggling is a collection of footguns IMHO but there are so many others in classic Forth it doesn't seem to be worth moaning about. π @neauoire Aside: Am I the only one who can never remember which is which between rot and -rot? I even wrote a fairly complete Forth implementation where they're consistently swapped, by accident. @pervognsen I usually can, but dig and bury are better names, whenever I can, I rename them, @neauoire @river For quotations capturing a value (`cons`) is the same as partially applying that quotation (`curry`). Both operations pull a value into a quote. `cons ( [a] [b] -- [[a] b] )` is the same as `[ a ] [ b ] curry`. (Concatenative languages are a bit weird because you can apply `curry/cons` an unlimited number of times.) @neauoire hm... there's this table which maps a bunch of combinators to various languages, but it's not focused around stack. https://combinatorylogic.com/table.html not seeing what you'd put as the "stack operator name" even if you did map it to this table though. @neauoire What about KEEP from RPL? It takes a number, keeps those number of elements and clears the entire stack above it. @neauoire @aartaka for sure! They're not mine, they're collected from all sorts of stack languages |
@neauoire I don't know of any that aren't there.