On Sun, Aug 31, 2008 at 04:28:36PM -0500, John M. Dlugosz wrote:
> Has the "err" operator, as a low-precidence version of //, been removed?  

Yes.

> It's not mentioned in S03, and the semantics of "orelse" is different.  
> Is "orelse" supposed to be a direct replacement, meaning if you ignore 
> the parameter thing then it doesn't change anything?

You can use it the same way, but if you think of // and orelse as the
same operator at different precedence, it's not quite the reality.
I don't believe there is such a thing as a "defined-or" operator.
I think of // instead as a "default" operator, and as such it's
primarily useful at a precedence tighter than infix:<=>, and it almost
never cares about *why* the left side is undefined.  The "orelse"
operator is aimed at logic programming, not defaulting, and in logic
programming the right side can often have additional dependencies
on the left side.  It's almost an accident that both operators care
about whether the left side is defined.  (This is also why there is
no tight version of "andthen".)

Of course, there's more to it than that.  Politically, it's a kind
of compromise between p5p and me.  I hated their "dor" operator,
and p5p by and large hated the "err" operator.  The result was that
we switched to "orelse" and they dropped "dor".  So the preceding
paragraph can be construed as a mere rationalization of why the
sausage came out of the sausage factor green this time.  :)

Larry

Reply via email to