chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH][5] and-let* and SRFI-2


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH][5] and-let* and SRFI-2
Date: Sat, 2 Dec 2017 17:02:33 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Sun, Nov 12, 2017 at 07:14:45PM +0100, lemonboy wrote:
> Hello hackers,
> here's a patch to make and-let* behave as specified in the SRFI-2, I've also
> included the "official" test suite and all the checks pass now.

Looks good, signed-off patch attached.

I think it's probably best to apply it only to chicken-5 unless anyone
is strongly in favour of applying it to master as well.

> One minor nit: with regards to the variables bound in this construct, the 
> SRFI-2
> states the following
> 
> > As usual, all VARIABLEs must be unique (like in let*)
> 
> I wasn't aware of such a restriction in let* nor I have found any reference to
> that in the R5RS, a single test has been modified to take into account this
> difference.

hm, I guess it depends on how you read it.  The description of "let" says:

  It is an error for a <variable> to appear more than once in the list of
  variables being bound.

The description of let* just says

  Let* is similar to let, but the bindings are performed sequentially
  from left to right, and the region of a binding indicated by
  (<variable> <init>) is that part of the let* expression to the right
  of the binding.

So depending on how you read it, the restriction in "let" that the
variables may appear only once might also apply to "let*".  But that's
a silly restriction, and I haven't been able to find a Scheme
implementation that uses this restricted interpretation.  So I think
we're fine by dropping that particular restriction of and-let*.

Besides, "it is an error" just means "you can do whatever you want",
anyway ;)

Cheers,
Peter

Attachment: 0001-Make-and-let-behave-as-specified-in-SRFI-2.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]