|
From: | Paul Eggert |
Subject: | Re: Change of Lisp syntax for "fancy" quotes in Emacs 27? |
Date: | Thu, 4 Oct 2018 18:01:26 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
Consider this example, abstracted from the auth-source-secrets-create source code:
(if (eq r 'secret) (let ((data data)) (lambda () data)) data)The intent of the (let ((data data)) ...) code is to create a thunk which, when evaluated, yields the current value of 'data' (not the value of 'data' when the thunk is called), and that is what any human reading the code will see. However, that is not what the code actually does. In the (let ((data data)) ...), the space between the two instances of 'data' is really an EN SPACE (U+2002) so the 'let' is declaring an identifier 'data data' whose name contains an EN SPACE and whose value is nil, an identifier that is never used; so the thunk yields the later value of 'data', not the earlier one.
Because humans cannot reliably review source code containing characters that are easily confusable with the ASCII symbols that are a basic part of Elisp syntax, we should not be relaxing the reader to encourage developers to use these characters in their identifiers. On the contrary, we should be discouraging their use even more than we do now.
[Prev in Thread] | Current Thread | [Next in Thread] |