On Thu, Mar 28, 2002 at 10:34:48PM -0800, Brent Dax wrote:
> Steve Fink:
> # Returning NULL seems rather harsh. Is this the right way?
> #
> # Index: classes/perlundef.pmc
> # ===================================================================
> # RCS file: /home/perlcvs/parrot/classes/perlundef.pmc,v
> # retrieving revision 1.10
> # diff -u -r1.10 perlundef.pmc
> # --- classes/perlundef.pmc   10 Mar 2002 21:18:13 -0000      1.10
> # +++ classes/perlundef.pmc   29 Mar 2002 06:04:38 -0000
> # @@ -57,7 +57,7 @@
> #
> #     STRING* get_string () {
> #        Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG, "Use
> # of uninitialized value in string context");
> # -      return NULL;
> # +      return string_make(INTERP, "", 0, 0, 0, 0);
> #     }
> 
> The string_* functions treat NULL and an empty string as equivalent, so
> this saves time in case we don't actually do anything with the string.

Okay, I just checked and you're right. I ran into it because not
everything goes through the string_* functions. Actually, I looked
through everything and it appears that everything non-IO-related is
ok, but the IO stuff all assumes non-NULL.

I'll open a bug on it instead.

-- 
Gimme a job! http://foxglove.dnsalias.org/~sfink/job.html
C, perl, networking, performance optimization, Java, XML.

Reply via email to