Category:Programming paradigm/Concatenative: Difference between revisions

m
formatting
mNo edit summary
m (formatting)
 
Line 4:
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,
 
* <ttcode>3 4 +</ttcode> might push 7.
* <ttcode>9 7 -</ttcode> might push 2.
* The concatenation <ttcode>3 4 + 9 7 -</ttcode> might push both 2 and 7.
* The concatenation <ttcode>3 4 + 9 7 - *</ttcode> might push 14.
 
The major difference from other programming paradigms is, that concatenative languages have combinatory logic as the predominant computational approach compared to others which use Lambda calculus, or Turing machines.
 
This approach is possible in other programming languages also. For example the [[tacit programming]] style of [[APL]] and point free style of haskell[[Haskell]] is similar to this.
559

edits