Email or username:

Password:

Forgot your password?
Devine Lu Linvega

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!

A list of stack combinators and their stack effects notation.
18 comments
Zorro Notorious MEB 😑

@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. πŸ˜‰

Devine Lu Linvega

@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.

Zorro Notorious MEB 😑

@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. πŸ˜‰

Per Vognsen

@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.

Devine Lu Linvega

@pervognsen I usually can, but dig and bury are better names, whenever I can, I rename them,

Devine Lu Linvega

@river I think so, @capital explained to me that curry is a generalization of cons.

Capital

@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.)

Ciel

@neauoire hm... there's this table which maps a bunch of combinators to various languages, but it's not focused around stack. combinatorylogic.com/table.htm

not seeing what you'd put as the "stack operator name" even if you did map it to this table though.

Elias MΓ₯rtenson

@neauoire What about KEEP from RPL? It takes a number, keeps those number of elements and clears the entire stack above it.

PypeBros

@neauoire I must admit that such list of names doesn't give me confidence into the power of the language. A bit too much CISC to my tastes...

David JONES

@neauoire omg DIG and BURY are so much better than ROT and -ROT

Floating Point Error

@neauoire
Wow, what a collection! Can I use these in one of my projects (stdlambda)?

Go Up