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

REPL: Warning about underscore #4528

Closed
xixixao opened this issue Apr 24, 2017 · 8 comments
Closed

REPL: Warning about underscore #4528

xixixao opened this issue Apr 24, 2017 · 8 comments

Comments

@xixixao
Copy link
Contributor

xixixao commented Apr 24, 2017

I can't find an existing issue for this:

$ node -v
v7.9.0
$ coffee -v
CoffeeScript version 1.12.5
$ coffee
coffee> 4
Expression assignment to _ now disabled.
4
coffee>

Node REPL is constantly warning that assignment to underscore is now disabled. Latest Node, latest CS.

@GeoffreyBooth GeoffreyBooth changed the title Repl warning about undescore Repl warning about underscore Apr 24, 2017
@vendethiel
Copy link
Collaborator

See nodejs/node#5431 for rationale

@xixixao
Copy link
Contributor Author

xixixao commented May 7, 2017

@vendethiel Might explaining specifically for CoffeeScript? I am not using any explicit _ assignment I'm aware of.

@vendethiel
Copy link
Collaborator

Look at the repl code. We generate an assignment to _ to force it to be an expression.

@lydell
Copy link
Collaborator

lydell commented May 7, 2017

Couldn't we assign to some other name, then?

@vendethiel
Copy link
Collaborator

Yes, we need to do this. My comment didn't mean we should close the issue.

@lydell lydell reopened this May 7, 2017
@GeoffreyBooth
Copy link
Collaborator

We do this because the Node REPL itself treats _ as a special case, assigning it to the last returned value:

$ node
> a = 1
1
> _
1

As @vendethiel noted above, see nodejs/node#5431.

@xixixao
Copy link
Contributor Author

xixixao commented May 7, 2017

Can we just assign to __ ? This is super annoying in the REPL.

@GeoffreyBooth GeoffreyBooth changed the title Repl warning about underscore REPL: Warning about underscore May 8, 2017
@GeoffreyBooth
Copy link
Collaborator

Resolved by #4559.

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

4 participants