Skip to content

iteration variables should be local to comprehensions #547

@rtzui

Description

@rtzui
x="a"
y=[ sqrt(x) | x = 1:10 ]

x==10 is true
I think that's strange. x should be a local variable in that loop. Also Haskell style comprehensions are cool. On the one hand like map:

x=[1,2,3,4,510,1,2,3,1,9]
y=[sqrt(a) | a ∈ x]

On the other hand more powerful:

x=[1,2,3,4,510,1,2,3,1,9]
y=[sqrt(a) | a ∈ x, x%2==0]

I 'd love unicode keywords (as valid alternative form), but i guess nobody else does.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions