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

No error when (compile-time) calling a macro before its definition in Rakudo #3605

Open
p6rt opened this issue Dec 12, 2014 · 2 comments
Open
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 12, 2014

Migrated from rt.perl.org#123419 (status was 'stalled')

Searchable as RT123419$

@p6rt
Copy link
Author

p6rt commented Dec 12, 2014

From @masak

<masak> m​: CHECK { say "switching to runtime" }; foo(); macro foo() {
say "OH HAI" }
<camelia> rakudo-moar 3fa1bd​: OUTPUT«switching to runtime␤OH HAI␤»
<masak> TimToady​: what should the semantics be of a macro that's
called before its declaration? error at CHECK time?
<masak> TimToady​: I think the above semantics is basically an emergent
accident, and should be fixed.
<masak> it's too surprising that the exact same statement might meant
two wildly different things depending on whether it comes before or
after its definition.
<jnthn> masak​: I'm inclined to agree
<masak> ok, that's good enough for me.
<masak> spec clarification coming up.
<jnthn> m​: say A; class A { }
<camelia> rakudo-moar 3fa1bd​: OUTPUT«===SORRY!=== Error while
compiling /tmp/5iWGahghKE␤Illegally post-declared type​:␤ A used at
line 1␤␤»
<jnthn> I think given a macro is als something effective at compile
time, we can argue it along the same lines as this
<jnthn> And maybe even implement it using the same mechanism.
<dalek> specs​: 272d12f | masak++ | S06-routines.pod​:
<dalek> specs​: clarify that macros can't be called before they're defined
<dalek> specs​: review​: Raku/old-design-docs@272d12fc84
<masak> ...and because it's now spec... :)
* masak submits rakudobug

To be clear, I would expect calling the macro `foo()` to result in an
error similar to the use of `A` before its definition.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2016

@coke - Status changed from 'new' to 'stalled'

@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