TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Borgia, William M." <[log in to unmask]>
Thu, 22 Apr 1999 15:39:32 -0400
text/plain (28 lines)
        >   X := Max(Max(Max(Max(23.0-6.5*Y,Y),Y+Z),Y-Z,Limit);
        >I could define a 'max' operator, and put (in Prolog):
        >   X is 23.0-6.5*Y max Y max Y+Z max Y-Z max Limit,
        >and, I think most readers will agree, this is more readable rather
        >less: the operator says what it means; it is associative, so its
        >of precedence doesn't matter; it is defined, fairly naturally I
think, at a
        >lower precedence than the arithmetic operators.

        I would have to disagree about precedence, since I find your
expression confusing at best.  The "standard" arithmetic operators have
precedence rules that are at least standard outside a software environment,
so those are read easier by a human.

        Ironically, I wouldn't use either expression in anything that I
build.  There are plenty of cases where function nesting becomes a bit too
complex regardless of the syntax.  What ever happened to temporary

        (No comments, Mike, about my "low" line of code count!)