[E-Lang] Hydro & E operator expansions

Bill Frantz frantz@pwpconsult.com
Wed, 21 Mar 2001 13:42:06 -0800


At 10:05 AM -0800 3/21/01, Tyler Close wrote:
>Somewhere in the depths of my mind, I have a memory of using a
>language that did use "|" for string concatenation. Does anyone here
>know where this memory came from?

PL/I used || for string concatenation.


At 3:34 PM -0800 3/20/01, Mark S. Miller wrote:
>>/                       divide()             approxDivide()
>
>This may be a good idea.  But what would you have divide() do on integers?

One could return [div, remainder], but that cure may be worse than the disease.


>After this message, Dean pointed out Python's convention of naming the
>operator expansions in a distinct fashion.  So instead of expanding "a + b"
>to "a add(b)" as we now do, or "a with(b)" as Tyler proposes above, we could
>instead expand to "a op__plus(b)" or some such.  The method name "op__plus"
>is clearly not primarily making a statement about semantics, but instead
>makes it clear that it's participating in the expansion of an operator.
>This should help de-couple language design from library design, which is a
>good thing.  Of course, we still need common agreement on what "+" means
>when applied to a primitive datatype that's considered part of the language,
>so most of the original problem remains.
>
>Does anyone object to this Python-like style of naming operator expansions?

No, however:

We have spend a lot of time on syntactic sugar for collection operations
etc.  I must admit that the only form of syntatic sugar the compels me is
one which eliminates the need to specify the variable twice in:

col := col with("foo"); or
col := col without("bar")

Having to specify the name of the variable twice is error prone.  The rest
of it seems to be a discussion of how to take these glyphs we learned in
school math class and apply them in new and creative ways to collections.
Wouldn't the collection operations be clearer with words describing the
operation rather than glyphs?

Cheers - Bill


-------------------------------------------------------------------------
Bill Frantz       | Microsoft Outlook, the     | Periwinkle -- Consulting
(408)356-8506     | hacker's path to your      | 16345 Englewood Ave.
frantz@netcom.com | hard disk.                 | Los Gatos, CA 95032, USA