all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* cl-loop extensibility is impossible with current documented interfaces
@ 2013-08-25  4:01 Daniel Colascione
  2013-08-25  4:37 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Colascione @ 2013-08-25  4:01 UTC (permalink / raw)
  To: Emacs development discussions

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cl-loop extensibility is impossible with current documented interfaces
  2013-08-25  4:01 cl-loop extensibility is impossible with current documented interfaces Daniel Colascione
@ 2013-08-25  4:37 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-08-25  4:37 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs development discussions

> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-25  4:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-25  4:01 cl-loop extensibility is impossible with current documented interfaces Daniel Colascione
2013-08-25  4:37 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.