Subject: Re: bug#28254: 26.0.50; SRFI-2 and-let*

From: Michael Heerdegen <[email-masked]>
Date: Wed, 13 Sep 2017 12:16:48 +0200

Mark Oteiza <[email-masked]> writes:

> > In `internal--listify':
> > isn't (or (listp form) (atom form)) always true?
>
> Yes, that could instead be (or form (null form)). It's meant to catch
> things like this:
>
>   (should (equal nil (and-let* ((nil) (x 1)))))

Why can't we just replace it with the equivalent `t' (and simplify the
code accordingly)?

> > Secondly, in `internal--build-binding-value-form':
> > How can it happen that (car binding) is an atom but not symbolp?  And if
> > (car binding) == var is not a symbol, how does the returned binding make
> > sense?
>
> It's an expression, like a number.
>
>   (should (equal 1 (and-let* ((2) (x 1)))))

AFAICT, this doesn't run the code I mention.  If I trace
`internal--build-binding-value-form' and try this, I get

1 -> (internal--build-binding-value-form (#:s nil) t)
1 <- internal--build-binding-value-form: (#:s (and t nil))
======================================================================
1 -> (internal--build-binding-value-form (x 1) #:s)
1 <- internal--build-binding-value-form: (x (and #:s 1))

In both cases, (car binding) evals to a symbol.

Thanks,

Michael.