From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: guile-devel <guile-devel@gnu.org>, Guile User <guile-user@gnu.org>
Subject: Python
Date: Sun, 19 Sep 2021 21:49:31 +0200 [thread overview]
Message-ID: <CAGua6m0ok70xRKMM+X5CwFtDW2hHYcCDtENcPbbxJJ3bzLuM0Q@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
in python on guile you can do,
def g(yield_fkn,x):
yield_fkn(x+1)
yield_fkn(x+2)
and
def f(l):
for x in l:
g(yield,x)
and this extension works like this in python on guile
list(f([1,2])
--> [1,2,2,3]
Nifty right. This is thanks to the superb infrastructure in
scheme (selimited continuations). Not only this, in python-on-guile the
generators and iterators are serialisable and hence you can deep copy them.
(on the condition that you turn off unboxing in the compiler).
[-- Attachment #2: Type: text/html, Size: 748 bytes --]
reply other threads:[~2021-09-19 19:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGua6m0ok70xRKMM+X5CwFtDW2hHYcCDtENcPbbxJJ3bzLuM0Q@mail.gmail.com \
--to=stefan.itampe@gmail.com \
--cc=guile-devel@gnu.org \
--cc=guile-user@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.
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).