Message from discussion
Testing for null
Newsgroups: perl.perl6.internals
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <l...@toetsch.at>
Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-intern...@perl.org
Delivered-To: perl6-intern...@perl.org
Message-ID: <200312031543.hB3FhLW12882@thu8.leo.home>
To: boemm...@physik.uni-kl.de (Juergen Boemmels)
Subject: Re: [RfC] Testing for null
In-Reply-To: <m2y8tu0xjg.fsf@helium.physik.uni-kl.de>
References: <m2y8tu0xjg.fsf@helium.physik.uni-kl.de>
Reply-To: l...@toetsch.at
Cc: perl6-intern...@perl.org
Date: Wed, 3 Dec 2003 16:43:21 +0100
X-Spam-Check-By: one.develooper.com
X-Spam-Status: No, hits=-1.0 required=7.0 tests=CARRIAGE_RETURNS,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01 version=2.44
X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/
Approved: n...@nntp.perl.org
From: l...@toetsch.at (Leopold Toetsch)
Lines: 25
Juergen Boemmels <boemm...@physik.uni-kl.de> wrote:
> Hi,
> I'm curently playing around with open calls returning a PMCNULL
> instead of a half valid IO-Object. But the main problem with that is
> that there is currently no way for the byte-code to detect such a
> case.
C<defined> tests for PMCNULL too and is usable.
> * A PMCNULL has false semantics. This may be done by letting
> get_boolean return FALSE, or by adding a test to if_p_ic op:
> if(!PMC_IS_NULL($1) && $1->vtable->get_boolean($1))
Or the null.pmc gets a valid get_bool() vtable slot returning 0.
OTOH when PMCNULL is a real NULL, this will fail then.
> * Have a special op for this if_null and unless_null which exlusively
> test for NULL.
Probably better.
> boe
leo