Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish they had made lexical scope work like Lua, where the binding simply does not exist before the declaration – including in the initialization expression:

    local x = 42
    do
      print(x) -- 42
      local x = x * 2
      print(x) -- 84
    end
    print(x) -- 42
Look, ma! No dead zones!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: