[CM] s7_nil behaving as #t

Iain Duncan iainduncanlists at gmail.com
Tue Sep 8 06:59:08 PDT 2020


Yes, as long as S7 is "mostly r5rs" as the docs state, then *only* #f can
evaluate as #f.  Nil and 0 both have to evaluate as #f in a boolean
context. A bit different but has its uses! Which is why recusing over
scheme lists, the base check is usually done with the null? predicate:
(null? list-that-might-be-empty :alldone)

iain

On Tue, Sep 8, 2020 at 4:26 AM Orm Finnendahl <
orm.finnendahl at selma.hfmdk-frankfurt.de> wrote:

> Hi,
>
> Am Dienstag, den 08. September 2020 um 13:11:02 Uhr (+0200) schrieb
> Kjetil Matheussen:
> > There's lots of situations where this would be practical, but since s7
> > is a Scheme implementation, I think it's probably best to behave as #t
> > to avoid trouble when porting to other scheme implementations. Also,
> > people who knows scheme would be confused if '() returned #f.
>
> Exactly. This is a well known (much discussed) difference between
> scheme and common lisp (or other dialects) and would break scheme if
> changed. If you feel adventurous, I'd recommend to overwrite if at the
> beginning of your code or define a custom macro of a different name
> which behaves like cl's if for the use cases where you need this
> behaviour.
>
> --
> Orm
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20200908/0075addc/attachment.html>


More information about the Cmdist mailing list