Re: some proposed changes
- From: Huw Rogers <count0 building2 co jp>
- To: orbit-perl-list gnome org, Owen Taylor <otaylor redhat com>
- Subject: Re: some proposed changes
- Date: Fri, 03 May 2002 10:26:00 +0900
> >
> > Huw Rogers <count0 building2 co jp> 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 <rogers building2 co jp>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]