[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [NOISE] Curly braces [was Re: Curl]
"S. Alexander Jacobson" <alex@shop.com> writes:
> What about postfix?
>
> From a user interface perspective, HP successfully convinced many people
> to use Postfix calculators. Forth and Joy use it at the language level.
> The great thing about postfix is you get rid of both precedence and
> parentheses, which makes code look much cleaner and allows you to arrange
> it in any way you like to enhance readability.
You can rearrange its indentation and whitespace, but you can't
rearrange it to read left to right.
> But, this is not just a syntax issue. Postfix protects you from a large
> class of errors associated with variables and destructive update.
>
> Postfix languages don't have variables. Values are simply placed on the
> stack and operated on. All functions are just operations on a stack.
A particular language that uses postfix syntax (for instance Forth)
may not have `variables' in the sense of arguments, but they *do* have
`variables' in the sense of `identifiers' that map to a meaning.
> So you immediately eliminate the large class of errors that come from
> destructive updates to shared data structures without having to jump
> through all the hoops that functional programming languages force on you.
Postfix syntax doesn't do squat for aliasing. The syntax of the
language is unrelated to whether there are primitives within the
language that support destructive updates.
> You also eliminate all errors associated with variable scope because you
> get rid of variables.
You also eliminate lexical scoping. The baby has been thrown out with
the bath water.
In addition, you *increase* the ease at which wrong number of argument
errors are generated and propagated.
Don't get me wrong, I love my HP calculator, but a postfix language
isn't a panacea.
~jrm