Skip to content

Comment on I created the BIPLAN programming language, what do you think about it?parent

Comments

This is Polish Notation, and it does not have this problem as long as you don't allow variadic functions. If functions always consume the same number of arguments, it's no problem at all.

This is basically how concatenative stack-based languages do it, although by convention they put the arguments before the function call. (Reverse Polish Notation) In Forth, your example would be written one of the following two ways, depending on whether multiply() or sum() is consuming the extra 2:

2 2 2 * 2 + +

8

2 2 2 * * 2 +

10

Also valid would be:

2 2 2 * 2 +

2 6

where the left-most 2 is not consumed, but rather is left in place.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.