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: Jonathan Johnson <jonj at realsoftware dot com>
Date: Thu, 30 Jun 2005 11:45:34 -0500
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>

On Jun 29, 2005, at 11:09 PM, Norman Palardy wrote:


On Jun 29, 2005, at 7:48 PM, Mars Saxman wrote:



On Jun 29, 2005, at 6:19 PM, Stefan Pantke wrote:


I asked for an EBNF, since this generates a compiler error:

    "the beginning" + (New Date()).SQLDate() + "and the end"

I don't see an error here. Do you?


Not exactly... but I do see evidence of a very tricky language design problem, which has surprising yet unavoidable consequences. A parenthesized subexpression is never a valid left-hand term for the dot operator.


That's an interesting thing to note.

Can I ask why not ?

In a situation like this, it becomes ambiguous:

Sub Foo( s as String )
 ... do something
End Sub
Function Foo( d as Date ) as Date
 ... do something
End Function

Foo(new Date).SQLDate

Disallowing the dot operator on a parenthesized subexpression allows you to know that "new date" in this context will always be considered to be a parameter to the Foo function. Granted, the above is a very tricky thing that I wouldn't ever want to see in my project (the overloaded Foo taking different types, and lacking or returning a different type), it's still technically legal.

-Jon


--
Jonathan Johnson
REAL Software, Inc.

_______________________________________________
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>