You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<masak> m: CHECK { say "switching to runtime" }; foo(); macro foo() {
say "OH HAI" }
<camelia> rakudo-moar 3fa1bd: OUTPUT«switching to runtimeOH 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/5iWGahghKEIllegally 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.
Migrated from rt.perl.org#123419 (status was 'stalled')
Searchable as RT123419$
The text was updated successfully, but these errors were encountered: