realbasic-nug
[Top] [All Lists]

Re: What are expressions? (ByRef)

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: What are expressions? (ByRef)
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Thu, 30 Jun 2005 15:18:47 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <74E7BAE3-09DD-46EC-A8CF-0FA300ABA748 at kellerfarm dot com> <AD07E2C3-D1A7-4021-8A20-D3F5B446A3A4 at mac dot com> <2BDABF28-C41C-43E3-B5F8-CCF65D3EC8B4 at haranbanjo dot com> <EEE66340-86F2-4B35-BD23-A01BA34D13F4 at GreenRiverComputing dot com> <44E68F94-5463-4092-A68D-DAB511DD6859 at mac dot com> <F6361DE1-E6DD-4A40-9BCD-D50A51D19876 at mac dot com> <272A5BB6-9136-41FD-8D04-E95C8F323AE8 at realsoftware dot com> <4c2b930a8a65d2a9639b5a7262c01fdd at great-white-software dot com> <9322004A-7EC8-482C-91C3-E6D434B7E371 at realsoftware dot com> <558f7c3d678a869e283f0ddc379b3bf0 at great-white-software dot com> <BFB2C14D-3FAE-4B25-A1FD-C1A4F91D893E at realsoftware dot com> <99FCA9C5-7CAC-4969-914B-18C851628D2B at mac dot com> <3424EA5D-F6B0-434C-BBDA-C5C58776145E at haranbanjo dot com> <609CCB22-ECB5-4A73-9017-9E39E5DA0A36 at mac dot com>

On Jun 30, 2005, at 3:06 PM, Stefan Pantke wrote:


Am 30.06.2005 um 20:42 schrieb Will Leshner:


On Jun 30, 2005, at 11:30 AM, Stefan Pantke wrote:


If RB would require the developer to use (..) for all parameters,
code would be more readable


I think subroutine calls without parens is just easier to read. In general, I find that less extraneous punctuation makes code more readable.

Well, the RB community tends to think different than
the world ;-)

If I remember correctly, an Appollo mission failed due
to a Fortran error coding error related to syntactical
issues. But I may be wrong.

Perhaps you're thinking of Ariane 5.

In fact, I'm absolutely sure, that parens for parameter
lists make things not a bit, but MUCH more readable - not
to speak of parsing stuff, since is only a technical issue
for the RB compiler writer.

This language design issue leads to the described problem.
And just this is a good reason to drop this concept.

I asked for an EBNF, but RS never provided one. And not
even a single page in the docs - I may have overlooked it -
explains on one page, how precedence is defined.

RB's goal is to be a 'secure' and 'simple' language. At least
for this reason, the design is bad. You probably know, how
precedence is defined, but I'm pretty sure, that others
don't know. Moreover, I'm sure that other programming beginners
will most likely write code, which gets rejected due to some
precedence rule and unexpected evaluation.

Have a look at this

    foo 1+ goo 2

Is the meaning of this obvious? Is it

    foo( 1 + goo( 2 ) )
or
    foo( 1 ) + goo( 2 )

Do you really think, that the first line is more readable
than the 2 lines below? Is the first line syntactically correct
with respect to RB anyway?

Another example:

    dummyI = max( 2, max( 3,4 ))
    dummyI = max 2, max( 3,4 )
    dummyI = max( 2, max 3,4 )
    dummyI = max 2, max 3,4

The first line compiles, while all other lines report error messages.

Can you explain why?

Indeed I can. In the last three cases, the lack of parentheses means that max 3, 4 must be a subroutine that does not return a value. Thus nothing is being passed to the second parameter in the outer call to max.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>