Re: some proposed changes
Huw Rogers <[email protected]> Fri, 03 May 2002 10:26:00 +0900
| Newsgroups | gmane.comp.gnome.orbit.perl |
|---|---|
| Message-ID | <[email protected]> |
> > > > Huw Rogers <[email protected]> writes: > > > * if a sequence is undef, it is marshalled as a zero length sequence. > > > Right now if it is not a true reference to an array it dies. > > > > I don't agree with this at all. > > > > $a = []; print scalar (@$a), "\n"; > > $a = undef; print scalar (@$a), "\n"; > > > > Are very different; the second one is a warning. > > > > Allowing this would be similar to allowing "undef" to be marshalled as > > an empty string without any warning, which is similar to thinking > > in C that "" is the same as NULL. <shudder> > > The sequence marshalling of undef is the most dubious of my proposals, > and I guess I should retract it. Having said that, $a = []; print scalar (@$a), "\n"; $a = undef; print scalar (@$a), "\n"; results in: "0" and "" being printed with no warnings. $a = []; print int(@$a), "\n"; $a = undef; print int(@$a), "\n"; results in "0" and "0" being printed, again with no warnings. In general, I'd like things to behave in a Perl like fashion, including "auto-vivification" of CORBA data structures as necessary. -Huw -- Huw Rogers <[email protected]>