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 use a file with INIT more than once. #56

Closed
coke opened this issue Sep 29, 2012 · 2 comments
Closed

can't use a file with INIT more than once. #56

coke opened this issue Sep 29, 2012 · 2 comments

Comments

@coke
Copy link
Contributor

coke commented Sep 29, 2012

One of the changes between parrot-nqp and nqp is 'our' variables; to compensate for the changed behavior, I tried a workaround to INIT() a lexical variable and then create a sub that returns this lexical. Then export the sub from that file so I can get a similar effect as the original our.

However, the INIT is causing problems, as seen below. Getting this fixed (or providing a way to share variables between use'd files) will help unblock partcl-nqp

$ cat a.nqp
INIT {
say("INIT");
}
$ cat b.nqp
use a;
$ cat c.nqp
use a;
use b;

say("alive");
$ nqp --target=pir a.nqp > a.pir
$ nqp --target=pir b.nqp > b.pir
$ nqp c.nqp
INIT
error:imcc:syntax error, unexpected IDENTIFIER ('INIT')
in file './b.pir' line 1

@arnsholt
Copy link
Contributor

arnsholt commented Oct 6, 2013

This still happens on latest NQP.

@pmurias
Copy link
Contributor

pmurias commented Jul 24, 2016

Seems to be parrot specific.
Works on current MoarVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants