unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Daniel Colascione <dancol@dancol.org>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: RFC: Generators v2
Date: Mon, 26 Aug 2013 12:05:52 -0400	[thread overview]
Message-ID: <jwvfvtw78lx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <52198EF7.50900@dancol.org> (Daniel Colascione's message of "Sat,  24 Aug 2013 21:58:31 -0700")

> At https://github.com/dcolascione/elisp-generators, I've updated my
> elisp generator support. Please take a look.

I like generators, and your package looks interesting.  I'd be very
happy to put it in GNU ELPA at least.

> integration, a few more testcases, and a lexical-binding assertion.

The top-level (assert lexical-binding) checks that lexical-binding is
true at run-time, whereas you only care about its value at
macro-expansion time.

> I'd eventually like to integrate this package into the Emacs core,

As I said, I like the idea.  But I'm wondering how well it works
in practice.  The code it generates seems to be extremely inefficient
(not that I know an easy way to make it more efficient, mind you).

> so I've laid claim to a few symbols in the global namespace, like
> next.

IIUC `yield' can only appear lexically within `defgenerator', so whether
its namespace-cleanliness is not much of a problem.

I see we already have `next' in Emacs's core, which we call `funcall'.
I agree that `funcall' is not an intuitive name, but I'm not sure I like
the idea of claiming `next' for it, right now.  If/when generators move
to the core, I might change my mind, of course.

We could do away with the funcall altogether using an flet-like macro:

   (flet-like ((g (y 10)))
     (g)
     (g)
     (g)) => 7

> This package actually defines a generic iterator protocol, and
> it'd be useful eventually to define iterator objects for things like
> buffers and windows instead of relying on enumeration callbacks.

Agreed,


        Stefan



      parent reply	other threads:[~2013-08-26 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-25  4:58 RFC: Generators v2 Daniel Colascione
2013-08-25  8:28 ` Nic Ferrier
2013-08-25 13:56   ` Stephen J. Turnbull
2013-08-25 20:00     ` Daniel Colascione
2013-08-26  3:53       ` Stephen J. Turnbull
2013-08-26 16:05 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfvtw78lx.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).