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

Idea: nested & #231

Open
akx opened this issue Jul 23, 2013 · 3 comments
Open

Idea: nested & #231

akx opened this issue Jul 23, 2013 · 3 comments

Comments

@akx
Copy link

akx commented Jul 23, 2013

thing1
  &thing2
    &doStuffWithThing2()
    &&doStuffWithThing1(&somethingFromThing2)

currently compiles to

var x0$, x1$;
x0$ = thing1;
x1$ = x0$.thing2;
x1$.doStuffWithThing2() && doStuffWithThing1(x1$.somethingFromThing2);

though it might be a nice feature to have N+1 ampersands refer to upper & scopes, ie

var x0$, x1$;
x0$ = thing1;
x1$ = x0$.thing2;
x0$.doStuffWithThing1(x1$.somethingFromThing2);

EDIT: (and &&&, &&&& etc. of course)

@vendethiel
Copy link
Contributor

syntactically conflitcts with &&, no ?

@akx
Copy link
Author

akx commented Jul 23, 2013

&& isn't unary though, so maybe something could be done to allow it in a prefix/standalone context. Either way making this change would break some programs that currently rely on space/newline elision before && (like what happens in the "currently compiled" result there).

&^, &^^ etc. would also be a (weird?) alternate syntax if &&, &&&, etc. aren't a Good Idea.

@vendethiel
Copy link
Contributor

Well, & isn't unary either (and shows some problems, sometimes).

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

2 participants