emacs-devel
[Top][All Lists]
Advanced

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

Re: Code for cond*


From: Alan Mackenzie
Subject: Re: Code for cond*
Date: Wed, 24 Jan 2024 19:12:03 +0000

Hello, Richard.

On Fri, Jan 19, 2024 at 22:39:39 -0500, Richard Stallman wrote:
> [[[ 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. ]]]

> Thanks.  I fixed the bugs you mentioned; elint did not show any
> others.  I always ran it interpreted to facilitate debugging, so I had
> never compiled it.

> Here is the new version.

> To test it thoroughly is more that I can try to do.  Could people please
> try using cond*?

I've read the code, briefly, and there're one or two things I'd like to
comment on.

In cond*-convert-condition, in

>                (if uncondit-clauses
>                    ;; bind* starts a non-exit clause.
>                    ;; Run the TRUE-EXPS.
>                    ;; Then always go on to run the UNCONDIT-CLAUSES.
>                    `(progn
>                       (if ,last-value
>                           (let* ,(cdr condition)
>                             . ,true-exps))
>                       (let* ,(cdr condition)
>                         ,(cond*-convert uncondit-clauses)))

, in the generated code, the form (let* ,(cdr condition) ...) sometimes
gets evaluated twice.  Surely this is a Bad Thing.  Or am I missing
something?

In cond*-match, you use gensyms.  I've not spent enough time
understanding the code, but would it be possible, somehow, to avoid
these?  The gensyms in pcase make the macro expanded code hard to read.
There one frequently has to distinguish between x293, x295, x296, ....
These symbols have no obvious relationship to the original code.  Worse,
they're not repeatable; because of the way gensym works, what was x293
last time will be x352 next time around, making it difficult to compare
two expansions.

> -- 
> Dr Richard Stallman (https://stallman.org)
> Chief GNUisance of the GNU Project (https://gnu.org)
> Founder, Free Software Foundation (https://fsf.org)
> Internet Hall-of-Famer (https://internethalloffame.org)

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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