Skip to main content
hugomg's user avatar
hugomg's user avatar
hugomg's user avatar
hugomg
  • Member for 1 year, 7 months
  • Last seen more than a month ago
awarded
awarded
comment
How can multiline lambdas be designed in indent based languages?
There are other indentation-sensitive languages that do care about indentation of nested sub-expressions. The key issue with Python is that it disregards all indentation that's inside parenthesis or brackets.
comment
Why do some PL choose to have a dedicated keyword for elseif instead of like in C?
The C specification does specify the nearest-if rule, so that all compilers will do the same thing with unbraced if-else. However, the real problem is that it's more confusing for programmers. The programmer might be thinking of the second option, but the compiler will actually do the first one.
awarded
comment
What are the pros and cons of register-based VMs and stack-based VMs?
Usually it's a big enough number (e.g. Lua has 256 registers)
awarded
revised
Loading…
revised
Loading…
Loading…
Loading…
revised
Loading…
comment
What are the disadvantages of using CPS form?
For Haskell, the laziness is probably more important than the purity when it comes to IR design. It doesn't have the usual notions of "control flow".
Loading…
awarded
comment
Why do some PL choose to have a dedicated keyword for elseif instead of like in C?
In Python, the dangling else problem is avoided by significant indentation, which is analogous to mandating braces around the if/else body. Python's elif allows if-else-if without having to nest the elses in increasingly deeper levels of indentation (which would be analogous to the }}} problem discussed in my answer).
awarded
revised
Loading…
revised
Loading…
awarded