On Jun 30, 2005, at 1:06 PM, Stefan Pantke wrote:
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?
This is invalid and won't compile
Meaning is the semantics of a language, and that is best defined by the
code that is written and usually parentheses help make it clear what
the meaning is by establishing evaluation order.
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?
Because Max is a function call and without the opening paren to
identify the argument list it's not clear what is arguments to the
function call
Moreover, the fact, that you can't use parens at certain position due
to this bad language design issue, is absolute contra-intuitive.
I agree that parens should be usable just about anywhere we want just
to force evaluation order and I still dont understand why the example
you posted with
"the beginning" + (New Date()).SQLDate() + "and the end"
did not work as it use parens to try and force the order but results in
a syntax error ....
_______________________________________________
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>
|