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

Can't refer to a constant in RHS of the constant declaration in Rakudo #2667

Open
p6rt opened this issue Mar 11, 2012 · 5 comments
Open

Can't refer to a constant in RHS of the constant declaration in Rakudo #2667

p6rt opened this issue Mar 11, 2012 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 11, 2012

Migrated from rt.perl.org#111674 (status was 'open')

Searchable as RT111674$

@p6rt
Copy link
Author

p6rt commented Mar 11, 2012

From @masak

<masak> nom​: constant catalan = 1, map { (4*$_ + 2) / ($_ + 2) *
catalan[$_] }, 0..*; .say for catalan[^10]
<p6eval> rakudo bd6fde​: OUTPUT«===SORRY!===␤CHECK FAILED​:␤Undefined
routine '&catalan' called (line 1)␤»
<masak> nom​: constant k = 1, map { k[$_] }, 0..*; .say for k[^10]
<p6eval> rakudo bd6fde​: OUTPUT«===SORRY!===␤CHECK FAILED​:␤Undefined
routine '&k' called (line 1)␤»
* masak submits rakudobug
<masak> nom​: constant k = k; say k
<p6eval> rakudo bd6fde​: OUTPUT«===SORRY!===␤Could not find sub &k␤»
<masak> nom​: constant k = 1; constant k2 = k; say k2
<p6eval> rakudo bd6fde​: OUTPUT«1␤»

@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

The error messages for the first two commands have changed slightly, but in the same way. I'm pasting the second example only​:

$ perl6 -e 'constant k = 1, map { k[$_] }, 0..*; .say for k[^10]'
===SORRY!=== Error while compiling -e
Variable '&k' is not declared
at -e​:1
------> constant k = 1, map { ⏏k[$_] }, 0..*; .say for k[^10]

But on MoarVM and JVM the third example now gives a different (though LTA) error​:

$ perl6-m -e 'constant k = k; say k'
===SORRY!===
Cannot invoke this object (REPR​: Null, cs = 0)

$ perl6-j -e 'constant k = k; say k'
===SORRY!===
Can not invoke object '&k'

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

The error messages for the first two commands have changed slightly, but in the same way. I'm pasting the second example only​:

$ perl6 -e 'constant k = 1, map { k[$_] }, 0..*; .say for k[^10]'
===SORRY!=== Error while compiling -e
Variable '&k' is not declared
at -e​:1
------> constant k = 1, map { ⏏k[$_] }, 0..*; .say for k[^10]

But on MoarVM and JVM the third example now gives a different (though LTA) error​:

$ perl6-m -e 'constant k = k; say k'
===SORRY!===
Cannot invoke this object (REPR​: Null, cs = 0)

$ perl6-j -e 'constant k = k; say k'
===SORRY!===
Can not invoke object '&k'

@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

Still reproducible (2017.11,HEAD(e5b660e)). Now it complains early and the error is not as LTA​:

===SORRY!=== Error while compiling /tmp/zOO8XZsbYQ
Undeclared routine​:
    k used at line 1

On 2015-03-10 05​:18​:33, bartolin@​gmx.de wrote​:

The error messages for the first two commands have changed slightly,
but in the same way. I'm pasting the second example only​:

$ perl6 -e 'constant k = 1, map { k[$_] }, 0..*; .say for k[^10]'
===SORRY!=== Error while compiling -e
Variable '&k' is not declared
at -e​:1
------> constant k = 1, map { ⏏k[$_] }, 0..*; .say for k[^10]

But on MoarVM and JVM the third example now gives a different (though
LTA) error​:

$ perl6-m -e 'constant k = k; say k'
===SORRY!===
Cannot invoke this object (REPR​: Null, cs = 0)

$ perl6-j -e 'constant k = k; say k'
===SORRY!===
Can not invoke object '&k'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant