* Python
@ 2021-09-19 19:49 Stefan Israelsson Tampe
0 siblings, 0 replies; only message in thread
From: Stefan Israelsson Tampe @ 2021-09-19 19:49 UTC (permalink / raw)
To: guile-devel, Guile User
[-- 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 --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-19 19:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-19 19:49 Python Stefan Israelsson Tampe
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).