On Thu, 10 Jan 2008, Ralf Hemmecke wrote:

| 
| > | Suppose I test with students :
| > | star (x, y) == x + y - x*y
| > | 
| > | Then I prefer the command (x *%* y) *%* z to star (star (x, y), z)...
| > 
| > If you use domains, you can overload + and *.
| 
| Sometimes I also wish to be able to introduce new operators. 
| Unfortunately, they are fixed in SPAD as well as in Aldor.
| 
| If I am allowed to dream then I would like to be able to write something 
| like
| 
|    (x: A) \oplus (y: A): A == ...
| 
| (with \oplus being the actual (unicode) character for that operator).
| 
| Of course that raises lots of questions and I am not 100% sure whether 
| it would be a good idea to
| 
|    1) allow unicode in identifiers
|    2) being able as a user to introduce new infix/postfix operators with
|       assigned precedences

What follows is a personal opinion, not logical universal statement.
My personal experience with introducing new operator is largely
negative (Haskell).  Allowing user to introduce new operators can be
seen as a god thing.  It usually comes with allowing users to specify
operator precendence (otherwise the feature is almost useless).  In
many cases, I got unpleasant surprises by combining third party
modules each with its own idea by precedence of same operators.  This
is harder to detect than conflicting types.  This isn't argument that
it should not be allowed in Spad; just that I really don't have a need
for it, and probably would not use it in my own codes.  But, I realize
that is not a universal opinion.

To answer your questions: In general Spad would need to support
unicode, not just because of user-defined operators.  Yes, user
defined infix, postfix and precedence should be allowed otherwise the
feature becomes almost useless.

But again, looking at the codes (mostly Haskell, ML) that make heavy use
of it, I do not get the sense that codes get improved in clarity.

-- Gaby

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to