For years now, I've taken it for granted that "begin" in Scheme and "do" in Arc are macros. In Nulan, "do" is also a macro, and it expands to a JavaScript semicolon/comma. If I recall correctly, Scheme does not guarantee the evaluation order of arguments, so that's a good reason for Arc to define "do" as a macro. In addition, because functions in Arc can have multiple expressions for their body, it's very easy to write "do" as a macro. But in Nulan, that isn't the case. Arguments are always evaluated left-to-right, and functions can only have a single expression as their body (which is why I need "do" in the first place!). So, I'm going to try defining "do" as a function that takes any number of arguments and simply returns its last argument. But I wonder if this is a good idea. Perhaps I'm missing something. Is there some important reason why "do" needs to be a macro? |