1. Short Circut

I can see both sides of this one, but I vote with Rob on this.    Boolean
sequence comparisons are needed, as are sequnce-operation type comparisons.
On the grounds of frequency, = would return a boolean, and a keyword would
be used for the sequence operation.  But on the grounds of symmetry with the
arithmetic operators, Rob designed it the other way.  Personally, I find the
way it is easier to remember--but I'm sure others have the opposite
experience.  For me, the deciding factor is that changing = (and >, >=,<,<=,
and !=) would break too much existing code.

Short-cuircuiting is now exactly as in C--and only makes a difference when
part of the statement has a side-effect:

if x>3 and foo(x)!=7 then . . .

if x<=3 then foo will not be executed,

but in

return x>3 and foo(x)!=7

foo will always be executed.  I belive this asymmetry was introduced in
response to user requests and I could live without it, though it simplifies
comparisons:

if y!=0 and x/y<100 then . . .

rather than

if y!=0 then
    if x/y<100 then . . .

I vote to keep this as it is, but I have no strong feelings on this issue.

-- Mike Nelson

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu