Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closure in grep? #411

Closed
p6rt opened this issue Nov 17, 2008 · 6 comments
Closed

closure in grep? #411

p6rt opened this issue Nov 17, 2008 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Nov 17, 2008

Migrated from rt.perl.org#60604 (status was 'resolved')

Searchable as RT60604$

@p6rt
Copy link
Author

p6rt commented Nov 17, 2008

From @ilyabelikin

Hi!
I start that message like bug report, but I have doubt.

example​:

class A {
  method foo (@​a) {
  @​a.grep​: { say @​a }; # just for example, real code not so pointless
  }
}

my $o = A.new;

$o.foo(['foo']); # foo
$o.foo([1, 2]); # foo
  # foo

Look like grep curls construct closure.
Mb it`s all right in perl6?

Ilya

@p6rt
Copy link
Author

p6rt commented Nov 17, 2008

From @pmichaud

On Mon Nov 17 01​:51​:40 2008, ihrd wrote​:

Hi!
I start that message like bug report, but I have doubt.

example​:

class A {
method foo (@​a) {
@​a.grep​: { say @​a }; # just for example, real code not so
pointless
}
}

my $o = A.new;

$o.foo(['foo']); # foo
$o.foo([1, 2]); # foo
# foo

Look like grep curls construct closure.
Mb it`s all right in perl6?

This is yet-another lexicals bug, the same bug that causes an issue with
'gather' that masak reported in his use.perl post at
http://use.perl.org/~masak/journal/37871 .

So, I'm going to link this as "yet another lexicals bug" that I expect
to be fixed when the lexicals branch is finished.

Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Nov 17, 2008

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

From @pmichaud

Now fixed in r33193​:

$ cat 60604
class A {
  method foo (@​a) {
  @​a.grep​: { say @​a }; # just for example, real code not so pointless
  }
}

my $o = A.new;

$o.foo(['foo']); # foo
$o.foo([1, 2]); # foo

$ ./parrot perl6.pbc 60604
foo
1 2
1 2
$

Thanks!

Pm

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

From @pmichaud

Now fixed in r33193​:

$ cat 60604
class A {
  method foo (@​a) {
  @​a.grep​: { say @​a }; # just for example, real code not so pointless
  }
}

my $o = A.new;

$o.foo(['foo']); # foo
$o.foo([1, 2]); # foo

$ ./parrot perl6.pbc 60604
foo
1 2
1 2
$

Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Nov 25, 2008

@pmichaud - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 25, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant