develooper Front page | perl.perl6.language | Postings from January 2003

Re: Arrays: Default Values

From:
attriel
Date:
January 28, 2003 20:50
Subject:
Re: Arrays: Default Values
Message ID:
1567.66.93.55.11.1043815370.squirrel@mail.d20boards.net
So ... with the discussion of "what if i really wanted to put an undef in
there b/c it's not just that i haven't defined it but rather that it
really isn't defined.  I KNOW it's not defined, and i'm now explicitly
saying it's undefined as opposed to before when i was implicitly
suggesting that i didn't know what it was and used a default 'unknown'"
discussion ...

What we really need is:

@a[2] = undef but undef;

or, possibly (more tongue-in-cheek-y)

@a[2] = undef but seriously;

so the ... property? would say "you have a default, maybe, but i don't
care.  this is REALLY undef"

is that possible?  aside from it being disturbing to write "undef but
undef" :o

--attriel

(the first suggestion is serious, but the syntax is flawed; the second
suggestion has better syntax but is tongue-in-cheek suggested ... )





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About