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

That is indeed an issue. One way to solve it is to make all declarations at top-level of the REPL into globals.

Another way would be to operate at block- instead of line-level and just not allow local variable to be shared between blocks. Ie

    int i = 5 ↵
    printf("%i", i) ↵
would fail, but

    { ↵
        int i = 5; ↵
        printf("%i", i); ↵
    } ↵
would not.




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

Search: