Lazy eval
Stewart Gordon
smjg_1998 at yahoo.com
Wed Aug 23 11:03:38 PDT 2006
Frank Benoit wrote:
>>> func( char[] a ) vs. func( char[] delegate() dg )
>>>
>>> func( funcRetInt() ); vs. func( &funcRetInt );
>> If that's the case, then something's wrong. If funcRetInt returns a
>> char[], despite the name, then funcRetInt() is of type char[]. Therefore
>> it should match this first.
>
> This is the first example, showing a ambiguity
> func( char[] a ) vs. func( char[] delegate() dg )
If one overload matches exactly, it goes without saying that that's the
one that's called. As such, the programmer would do
func("qwert");
to call the first, and
func({ return "qwert"; });
to call the second. Just like in any other case.
> This is a second example, which has no relation to the first.
> func( funcRetInt() ); vs. func( &funcRetInt );
In that case, I don't get what your problem is.
> And the "vs." is not a object reference. Sorry.
Pardon?
>>> { "abc" } => char[] delegate()
>> That syntax looks confusingly like an array initialiser....
>
> the '=>' was not a syntax proposal
> "{ "abc" }" /is of type/ "char[] delegate()"
The '=>' doesn't look anything like an array initialiser either. Unless
there's some other kind of array initialiser that I haven't discovered
yet....
Wasn't it obvious that I was talking about the bit to the left of those
two characters?
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS-
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------
My e-mail is valid but not my primary mailbox. Please keep replies on
the 'group where everyone may benefit.
More information about the Digitalmars-d
mailing list