Operators for matrix: current choices (Was Matlab vs Python ...)

Michael Hudson mwh21 at cam.ac.uk
Thu Jul 20 02:52:50 EDT 2000


Paul Prescod <paul at prescod.net> writes:

> Michael Hudson wrote:
> > 
> > dipping in and out of this thread...
> > 
> >...
> > 
> > Still don't think runtime syntax extension is a good idea, but
> > unfortunately we can't claim that it's impossible.
> 
> There are all sorts of linguistic tricks that are possible if you are
> willing to rewrite the parser. I said that it wasn't possible with
> *Python's parser*.

So you did.  Must learn to read before posting on Usenet...  (Though
in my defence you did say "Parsers just do not work that way." which
is a bit of a generalisation).

> > What Haskell does is to declare that any sequence of characters from
> > the set [!+-*/$=%] (I think) to be an operator, much the same way as
> > any sequance of characters from [a-zA-Z_0-9] (ish) is a token in
> > Python today.
> 
> Consider:
> 
> +-+-+-+-5

Well, that's the operator +-+-+-+- followed by a five.  It's horrible,
yes - was that you're point?

Cheers,
M.

-- 
31. Simplicity does not precede complexity, but follows it. 
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list