[DGD] Re: casting nil (another idea...)

Michael McKiel crashnbrn71 at yahoo.ca
Tue Mar 23 23:52:15 CET 2004


 --- Steve Wooster <swooster at xprt.net> wrote: > 
> 
> In any case, I admittedly agree with you that it would be nice to be able 
> to explicitly cast nil to an int. Heh, I'm still miffed that "test"[2..6] 
> runtimes instead of returning "st". What I wouldn't give for a config 
> option to change that... Ah well, Dworkin has given us the sun and the 
> moon, so there's no reason to ask for the stars too.

I use an implementation of substr() to do that, though admittedly,
substr("test", 2, 6) is hardly as pretty ;)

And while typecasting int nil, would be interesting in a few respects, I
believe if it was to be bothered with at all, it would need to apply to all
variable types, and consider whether typeCasting nil's 
of string, should return ""
or mapping should return ([ ])
or string * should return ({ })

And then theres the consideration that nil is its own type, ala
if (typeof(foo) = T_NIL)

And I imagine there are supporters for both sides? that would prefer an error
on an attempt to typeCast something that is nil to start with...


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list