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

List Comprehensions: undefined existing list #125

Open
psytrx opened this issue Dec 22, 2014 · 1 comment
Open

List Comprehensions: undefined existing list #125

psytrx opened this issue Dec 22, 2014 · 1 comment

Comments

@psytrx
Copy link

psytrx commented Dec 22, 2014

I wonder why this isn't reported yet, maybe I'm missing something?

var lst = [0, 1, 2];
var lst2 = [n*n for n in lst];

I expect lst2 to equal [0, 1, 4], but compilation fails with

line 2   col 26  undefined lst
    var lst2 = [n*2 for n in lst]; 
                             ^^^
@maximsmol
Copy link

The example from http://spiderlang.org/#list-comprehensions also fails to compile

main.spider

var list = [1, 2, 3, 5, 6, 7];
var doubles = [x * 2 for x in list];

Output:

main.spider
  line 2   col 31  undefined list
      var doubles = [x * 2 for x in list]; 
                                    ^^^^
1 problem

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