OO (was: Why is tcl broken?)

William Tanksley wtanksle at dolphin.openprojects.net
Tue Jun 15 20:08:55 EDT 1999


On 16 Jun 1999 00:46:56 +0300, Harvey J. Stein wrote:
>wtanksle at dolphin.openprojects.net (William Tanksley) writes:

> > On Tue, 15 Jun 1999 01:54:53 GMT, Maxwell Sayles wrote:
> > >Robin Becker wrote:

> > >> postfix, prefix, infix etc etc are isosemantic

> > >for myself and the others who might not know... can we get an example of
> > >each?
> > >and i remember someone mentioned parenthesized vs non-parenthesized...

> > Prefix (C, Lisp, Scheme):

> >   function(that(x(1)))
> > or:
> >   (do-this (do-that (x 1)))
> > (Parenthesis are not optional)

> > Postfix (Forth, Postscript):

> >   3 4 + SWAP MOD do-that
> >   rinse on   agitate  10 seconds   rinse off
> > (Parenthesis are not optional)

> > As a common thread, note that in none of the languages are parenthesis
> > optional.  In Postfix parenthesis are not optional because they have nno
> > meaning; in the other languages they're assigned arbitrary meaning.

>This isn't a completely fair example.  Postfix can get away without
>parentheses only when a) everything that's not a number is a function
>and b) the arity (# of arguments) of each function is known and fixed.

Not true -- in Forth part (a) holds, but part (b) doesn't.  The number of
arguments and number of returns can vary arbitrarily; they're put onto and
taken off of a stack.

And I don't see the relevance of restriction (a).  It seems that with or
without it we would get the same result -- postfix doesn't need
parenthesis.

Oh, for example, Forth "immediate" words.  These aren't the same as other
functions, since they execute at compile time (in all other respects they
are functions, though).

Also, HP RPN uses syntactic elements which are neither numbers nor
functions.

So therefore, neither of your conditions are necessary.

>Given such restrictions one can also drop the parentheses in prefix
>notation.

You're right here, though.

>Infix still requires parentheses even given the above restrictions.

Yes.

We see that postfix never requires parenthesis, and prefix can skip its
parenthesis under certain conditions.  Are there any conditions under
which infix can ignore parenthesis?

>Harvey J. Stein

-- 
-William "Billy" Tanksley
Utinam logica falsa tuam philosophiam totam suffodiant!
   :-: May faulty logic undermine your entire philosophy!




More information about the Python-list mailing list