From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Python Date: Sun, 19 Sep 2021 21:49:31 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000037a19705cc5e775d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35376"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel , Guile User Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Sep 19 21:50:10 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mS2pE-00090z-Uz for guile-devel@m.gmane-mx.org; Sun, 19 Sep 2021 21:50:08 +0200 Original-Received: from localhost ([::1]:41300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mS2pC-0002hF-Vk for guile-devel@m.gmane-mx.org; Sun, 19 Sep 2021 15:50:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mS2ov-0002gy-P9; Sun, 19 Sep 2021 15:49:49 -0400 Original-Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:40561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mS2os-0005Aq-5C; Sun, 19 Sep 2021 15:49:48 -0400 Original-Received: by mail-ua1-x932.google.com with SMTP id g16so9732401uam.7; Sun, 19 Sep 2021 12:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=uo2xpX0W1vziIR3gEk9yiBOv1lhHto2taiIswWuaTZs=; b=JH9h5OAEAPy0hmkSZFrP9id85h+L9+yyoS3p58tjpYkWmIPWVoMyZ234z+hRFqZ4D0 RPP1CQFJw9o1AadPO9d288R8EiwXEBIRJq8E5nqkDJUDJdMXyFqzFOgVjTq7qRcXfEpH KEIUNsZm60d5B9P/U9I0IBb6t61h4G/sfxMcdiQYIfSvtAe5SUi7LxOh5pcCjf8Okgc3 d2UcxRMeHeIewUwppF1UBVTnLzViwP4gPvFvSugglnWadiYcMEPCl3Av+rAYcoZ1p/aA VdZW0OwefFSbZvIjWLZsPoHPbn7+17zgudKs9Xk5N5Lz+Hc6x+WkSoJ/iTLCvrnPbpW4 8Miw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uo2xpX0W1vziIR3gEk9yiBOv1lhHto2taiIswWuaTZs=; b=b/duGOQUs5lP8xEL437WjB6l4V1NtG3B+aQBuwNFlOeaHMyGtYBTjgplL3gpnXrw0v ZElH9AGUmccBOjPVoKx3iHC3XwKreQb3DLyBCYslB8QdVMdRmwfsXIY/nxA+lTc0rj5h Ip09tz5+0LFMUf9XwyNKpz3E0DDx7uwSYUefZgRVwyWn9HtObThhBSIC3zZ2+heLyJ/u UxNglUuHSRhXkDDrt1hjBrPb5qjY1hxEZJeYLlrI1QjJFg5sH3CwJMleBalCdkU71qWW LaQodG2O27LOcCFbo2gC7tH566oXLULt5NpG6j7n65mPDwBMZQcRwJQIgqhBJIsLWM+D jEcg== X-Gm-Message-State: AOAM530eaoJSxIp34YnDZbXWfeQH5dJZBTh5uh75sTM3+o3exGEAsTsn 2OdS4X9/58cDcS8z5miERar+3HdwEu6sRJtbFab1A0elrE4= X-Google-Smtp-Source: ABdhPJzAx6HGoHGX7YqMbWODdbV5yK/MtgfFGtBrtohM8o6viQbl72M3yeEKdvlNz6c/V6ojghOpjlRoyE9lqa0S2PQ= X-Received: by 2002:a05:6130:325:: with SMTP id ay37mr10985744uab.88.1632080982679; Sun, 19 Sep 2021 12:49:42 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=stefan.itampe@gmail.com; helo=mail-ua1-x932.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20866 gmane.lisp.guile.user:17762 Archived-At: --00000000000037a19705cc5e775d Content-Type: text/plain; charset="UTF-8" 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). --00000000000037a19705cc5e775d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
in python on guile you can do,

def g(yi= eld_fkn,x):
=C2=A0 =C2=A0 yield_fkn(x+1)
=C2=A0 =C2=A0 = yield_fkn(x+2)

and=C2=A0
def f(l):
=C2=A0 =C2=A0for x in l:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 g(y= ield,x)

and this extension works like this in pyth= on=C2=A0on guile

list(f([1,2])
--> [1= ,2,2,3]

Nifty right. This is thanks to the superb = infrastructure in scheme=C2=A0(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 co= mpiler).


--00000000000037a19705cc5e775d--