TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
"Borgia, William M." <[log in to unmask]>
Reply To:
Borgia, William M.
Date:
Thu, 22 Apr 1999 15:39:32 -0400
Content-Type:
text/plain
Parts/Attachments:
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
than
        >less: the operator says what it means; it is associative, so its
direction
        >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
variables?

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

        Bill

ATOM RSS1 RSS2