Category:Programming paradigm/Concatenative
Programming paradigm/Concatenative is a programming language feature.
Concatenative programming passes a single data structure from function to function. With a concatenative language, concatenation is function composition. The concatenation of two programs is a valid program that passes this single data structure from the first program to the second program.
This single data structure is probably a stack. A concatenative language is probably a stack-oriented language. These languages tend to use reverse Polish notation with postfix operators. Programs push values on the data stack, then operate on those values. For example,
- 3 4 + might push 7.
- 9 7 - might push 2.
- The concatenation 3 4 + 9 7 - might push both 2 and 7.
- The concatenation 3 4 + 9 7 - * might push 14.