4 ms·
Interesting. How would a line compile on its own if it's, say, "n += 2;" without providing the n?
by khyryk 12y ago
Interesting. How would a line compile on its own if it's, say, "n += 2;" without providing the n?
- cygx 12y agoThat 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.
- deleted 12y ago[deleted]