I agree, it's only a question of terminology. My comment was only that the definition as given was incomplete.
Thanks for the link. It's too much beyond me to really follow, but I've no doubt that such a definition is possible.
Would you say that Python's with statement is sugar? The PEP at https://www.python.org/dev/peps/pep-0343/ might suggest so, but Python has no way to generate new unique symbols for variables, so the translation of:
with open(filename):
pass
can't trivially be converted to:
mgr = (open(filename))
exit = type(mgr).__exit__ # Not calling it yet
value = type(mgr).__enter__(mgr)
exc = True
...
Renaming things isn't something you as a programmer should have to do; that should be handled behind the scenes by the desugaring system / macro expander. So yeah, I'd say that's a fine piece of sugar.
Thanks for the link. It's too much beyond me to really follow, but I've no doubt that such a definition is possible.
Would you say that Python's with statement is sugar? The PEP at https://www.python.org/dev/peps/pep-0343/ might suggest so, but Python has no way to generate new unique symbols for variables, so the translation of:
can't trivially be converted to: because of possible name collisions.