[Openmcl-devel] Where is the source of LET* macro

Robert Munyer 2420506348 at munyer.com
Tue May 23 15:11:16 PDT 2023


I actually believe that sometimes

    (let* ((FOO <a>)
           (FOO <b>))
      <c>)

can be clearer than

    (let* ((BAR <d>)
           (BAZ <e>))
      <f>)

, because you can know that <c> never touches the first binding of
FOO, without looking at the content of <c>, but to know that <f> never
touches the binding of BAR, you'd have to look at the content of <f>.

On 14 April 2023, Tim Bradshaw wrote:

> [...] anything else requires quite significant repairs to the
> standard: it can't just fail to say which bindings are affected
> if the answer is not 'all of them'.

I think making the standard match the CCL/ABCL/LW behavior also
would require repairs.  In many places it refers to "the binding"
to which a bound declaration applies, not "the binding or bindings".

I just evaluated

    (let ((x "does not affect"))
      (declare (special x))
      (let* ((x "affects")
             (x (locally (declare (special x)) x)))
        (declare (special x))
        (format nil "Declaration at line 5 ~a binding at line 3." x)))

in CCL and ABCL and SBCL:

  CCL:  "Declaration at line 5 affects binding at line 3."
  ABCL: "Declaration at line 5 affects binding at line 3."
  SBCL: "Declaration at line 5 does not affect binding at line 3."

I'm starting to think that the best way to respond to this would
be to have compilers signal a warning, whenever a bound declaration
applies to a LET* binding that has a namesake in the same LET*.


More information about the Openmcl-devel mailing list