emacs-devel
[Top][All Lists]
Advanced

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

Re: Code for cond*


From: Andrea Corallo
Subject: Re: Code for cond*
Date: Thu, 18 Jan 2024 10:44:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Here is the first draft of cond*.  I have tested some cases
> but I ask others to help in testing it more thoroughly.
>
> I invite constructive comments, bug reports, patches,
> and suggestions.
>
> First, here is the draft documentation.
>
>
> A cond* clause is a "non-exit" clause if it (1) starts with t, (2) has
> only one element, or (3) has a keyword as the first or last element.
> After a non-exit clause finishes, control proceeds to the following
> clause.
>
> All other clauses are like cond clauses, in that when the condition is
> true, it executes its clause body and then exits the cond*.
>
>   (cond* 
>        ;; Same as a clause in `cond',
>        (CONDITION
>         DO-THIS-IF-TRUE-THEN-EXIT...)
>
>        ;; Execute FORM, and ignore its value
>        ;; (except if this is the last clause).
>        (FORM)
>
>        ;; Variables to bind, as in let*, around the rest
>        ;; of the cond*.
>        ((bind* (x foobar) y z (foo 5) a))
>        ;; Bindings continue in effect for the whole cond* construct.

Hi Richard,

apologies if it was discussed already, wanted to ask: what is the reason
for some of these cond* clauses to keep the binding in effect outside
the clause itself and for the whole cond* construct?  At first glance it
doesn't look very idiomatic in Lisp terms to me.

Thanks!

  Andrea



reply via email to

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