emacs-devel
[Top][All Lists]
Advanced

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

Re: cl-loop extensibility is impossible with current documented interfac


From: Stefan Monnier
Subject: Re: cl-loop extensibility is impossible with current documented interfaces
Date: Sun, 25 Aug 2013 00:37:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> cl-loop defines cl-loop-for-handler and cl-loop-handler as public
> interfaces for extending the set of keywords that loop supports.
> There is no public interface, however, for doing anything useful in
> the functions these handlers describe.  We should document
> cl--loop-args and, for cl-loop-for-handler, loop-for-bindings,
> loop-for-sets, and loop-for-steps so that loop extenders don't have
> to understand the cl-macs source to understand what's going on.
> Additionally, we should *dynamically* bind loop-for-bindings,
> loop-for-sets, and loop-for-steps so that handler functions can
> actually modify these variables as they used to be able to do before
> lexbind.

Hmm... never realized there was such an extension mechanism.  No wonder
I broke it when I moved the code to lexical-binding.

If we want to document it, I think it would be good to change some of the
existing built-in functionality to make use of it (i.e. move it out of
the built-in code).  Maybe that could be done for the code that handle
looping over key bindings and over hash tables?

Would you like to take a crack at it?  The changes you suggest above
sound OK.  Except all the dynamically-scoped vars we might document
should use the "cl-loop-" prefix.

Do you know of existing code that used this functionality?


        Stefan



reply via email to

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