2 ms·
Well, I would imagine that it requires designing a language which ordinary does not allow adjacent identifiers. Of course keywords must not be allowed as part
by vbezhenar 4y ago
Well, I would imagine that it requires designing a language which ordinary does not allow adjacent identifiers.
Of course keywords must not be allowed as part of identifiers (or there should not be no keywords at all like with Lisp).
Just an example of my head that I didn't think really much about:
function print person (p: person) {
var full name = p.first name + p.last name;
if p.middle name != "" {
full name += p.middle name
}
print line(full name)
for c : p.subordinate person list {
print person(c)
}
}
I think this syntax should be parseable with little restrictions (like your identifier can't start with keyword).
- still_grokking 4y agoThat's completely unreadable! I can't "parse it" by looking at it, and a computer would have even more trouble doing so. How do I tokenise something like `full name += p.middle name`? Maybe as `(full) (name +=) (p.middle) (name)`? Or is it `(full) (name) (+= p.middle) (name)`? How about `print person(c)`? Is it the call of the `print` function with `person(c)` as argument?