FAQ
Folks,

I found this when I was playing w/ pugs.

pugs> { $^x }.(42)
42
pugs> { my $z; $^x }.(42)
*** Undeclared variable: "$^x"
at <interactive> line 1, column 10-14

So far as I see s06, there's nothing wrong w/ the statement above. I
just want to make sure this is not a perl6 feature.

I found this when I tried

{ my %n; { %n{ $^n } ||= ($^n <= 2 ?? 1 !! &?BLOCK($^n-1) + &?
BLOCK($^n-2)) }.($^n) }.(42)

This fails on pugs while

-> $n { my %n; { %n{ $^n } ||= ($^n <= 2 ?? 1 !! &?BLOCK($^n-1)
+ &?BLOCK($^n-2)) }.($n) }.(42)

beautifully returns 267914296.

Dan the Yet Another Pugs Addict

Search Discussions

  • Audrey Tang at Apr 12, 2006 at 12:57 am

    Dan Kogai wrote:
    I found this when I was playing w/ pugs.

    pugs> { $^x }.(42)
    42
    pugs> { my $z; $^x }.(42)
    *** Undeclared variable: "$^x"
    at <interactive> line 1, column 10-14

    So far as I see s06, there's nothing wrong w/ the statement above. I
    just want to make sure this is not a perl6 feature.
    This is a Pugs bug, so perl6-compiler is perhaps more adequate. :-)

    Please commit a test for it somewhere (in
    t/subroutines/implicit_parameters.t maybe?), as I've just fixed the bug.
    (r9913)

    { my %n; { %n{ $^n } ||= ($^n <= 2 ?? 1 !! &?BLOCK($^n-1) +
    &?BLOCK($^n-2)) }.($^n) }.(42)

    now evaluates to 267914296 here too. :)

    Audrey

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-language @
categoriesperl
postedApr 11, '06 at 5:17p
activeApr 12, '06 at 12:57a
posts2
users2
websiteperl6.org

2 users in discussion

Dan Kogai: 1 post Audrey Tang: 1 post

People

Translate

site design / logo © 2021 Grokbase