unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: raman@google.com (T.V Raman)
To: michael_heerdegen@web.de
Cc: emacs-devel@gnu.org, raman@google.com
Subject: Re: Generator Examples
Date: Sat, 24 Sep 2016 19:26:35 -0700	[thread overview]
Message-ID: <22503.13787.897462.68521@retriever.mtv.corp.google.com> (raw)
In-Reply-To: <87twd4lriz.fsf@web.de>

The bit you wrote in response to my "dont understand why nested
iter-yield" might do well in the manual. Also, it might do what it
claims, but why it does it is opaque -- and examples that do something
useful are usually easier to learn from.

Michael Heerdegen writes:
 > raman <raman@google.com> writes:
 > 
 > > The cl-psetq is the right idiom here in that sense -- if you use plain
 > > setq, you'd have to use a temporary variable?
 > 
 > Sure, but I want to avoid to confront people with functions they
 > potentially don't know in these examples, so that they can concentrate
 > on the gist.  A minor issue, sure.
 > 
 > > Thanks for the coroutine example, again that would do well in the
 > > manual -- there is a reference to coroutines either in the manual or
 > > in code comments in generators.el that is presently "intriguing".
 > 
 > AFAIK the original author wanted to add some code for working with
 > coroutines.
 > 
 > > Finally, I still dont understand the nested call to iter-yield in the
 > > manual and if it is correct, it would be good to have it better
 > > explained there.
 > 
 > I think it is correct (behaves exactly as described, and the behavior is
 > what I expect).  What in particular don't you understand?
 > 
 > I think the thing that this part wants to demonstrate is that
 > `iter-yield' behaves normally wrt when it is evaluated (function
 > arguments before function calls etc.; so the inner `iter-yield' is
 > called first, and the outer not before the iterator has been restarted).
 > And the outer `iter-yield' yields a value that is computed from the
 > "return value" of the inner, which is the second argument of the
 > according `iter-next' call.
 > 
 > 
 > Michael.

-- 

-- 



  reply	other threads:[~2016-09-25  2:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22  0:47 Generator Examples raman
2016-09-25  0:16 ` Michael Heerdegen
2016-09-25  0:29   ` raman
2016-09-25  1:03     ` Michael Heerdegen
2016-09-25  2:26       ` T.V Raman [this message]
2016-09-25  0:32   ` raman
2016-09-25  1:06     ` Michael Heerdegen

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=22503.13787.897462.68521@retriever.mtv.corp.google.com \
    --to=raman@google.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).