aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of anonymous arguments multiple times in an expression causes a name collision

MoonKraken opened this issue · comments

commented

Not sure if this is as designed, but it seems like something that should be doable:

let ans = a.filter(): _ % 2 == 0
    .map(): _ + 1

yields an "identifier shadowing" error on _, but the function bodies for both the filter closure and the map closure should both have their own isolated scopes right?

Given precedence of ., it is probably trying to parse this as 0.map(): _ + 1 which is probably not what you intended.
Try putting () around the whole filter ?