Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Undef issues: msg#00123

lang.perl.perl6.compiler

Subject: Re: Undef issues

Hi Stuart,

You (and Carl) are absolutely right... all these things are behaving as
they should. Cool! :-)

I'll fix the tests later on today.

Thanks,

Ade

Stuart Cook wrote:

>On 5/24/05, Adrian Taylor <ade@xxxxxxxxxxx> wrote:
>
>
>>eval_is('undef + 1', undef, 'undef + 1', :todo<bug>); # dies
>>
>>
>
>In this case, you're expecting
> (undef) + 1
>but you're getting
> undef(+1)
>instead.
>
>This is because 'undef' serves double-duty as both 'undefined value'
>and 'prefix op for undefining variables', and the op form is taking
>precedence in parsing.
>
>It's worth noting that Perl5 seems to have exactly the same parsing behaviour:
>
>$ perl -e 'print undef + 1'
>Warning: Use of "undef" without parentheses is ambiguous at -e line 1.
>Can't modify constant item in undef operator at -e line 1, at EOF
>Execution of -e aborted due to compilation errors.
>
>I'm not sure whether this behaviour is supposed to be changing.
>
>
>
>
>>eval_is('1 + undef', undef, '1 + undef', :todo<bug>); # gives 1
>>eval_is('2 * undef', undef, '2 * undef', :todo<bug>); # gives 0
>>
>>
>
>AFAIK, a vanilla (undef) numifies to 0, so these are already correct.
>If you were expecting undef to behave as a 'poisoned' value then I can
>understand the confusion.
>
>
>
>
>>eval_is('undef xx 2', undef, 'undef xx 2', :todo<bug>); # dies
>>
>>
>
>Again, you're expecting
> (undef) xx 2
>but you're getting
> undef(xx 2)
>instead.
>
>
>Stuart
>
>




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe