I quickly ported the JavaScript version of "nuit-serialize" to Arc (it's less than 50 lines of code) and I ran across this problem. Firstly, I prefix all the globals with "nuit-" to prevent name collisions because Arc has no namespace support. But that's not even the biggest problem. No, the biggest problem is that it didn't help at all. In "nuit-parse" I have a variable called "nuit-invalid" which is a string that describes which characters are invalid (while parsing). And in "nuit-serialize" I have a variable called "nuit-invalid" which describes which characters are invalid (while serializing). Oops. And I couldn't think of a better name for them. Yes I could use "nuit-invalid-parsing" and "nuit-invalid-serializing" or something even more retarded, but come on. This is a big pain. I should be able to just use "invalid" and have it Just Work. Of course this problem is completely solved by making the global namespace lexical rather than dynamic. Nulan does this, and you could just use "invalid" and there would be no problems. And it's super-easy to implement, and it's consistent, and it's amazing. It wouldn't even be hard to add in lexical global scope to Arc/Nu... hm... I'm actually thinking about making a language somewhere between Arc and Nulan... it would have some of the nice things in Nulan, but it would be compiled to Racket like Arc, so it'd be fast. It'd be a compromise between making a language that's practical (like Arc) and a language that's awesome (like Nulan). Ideally it'd also be fairly easy to compile it to JavaScript. |