From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Threading / Pipe Macro Date: Sun, 7 Jul 2019 12:42:03 +0200 Message-ID: <5f08685b-be5b-e584-af54-9f4244039b1a@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="214820"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jul 07 12:43:32 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hk4dn-000tn2-S5 for guile-user@m.gmane.org; Sun, 07 Jul 2019 12:43:32 +0200 Original-Received: from localhost ([::1]:34630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk4dm-0000tj-R1 for guile-user@m.gmane.org; Sun, 07 Jul 2019 06:43:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37528) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hk4cf-0000ja-BP for guile-user@gnu.org; Sun, 07 Jul 2019 06:42:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hk4cd-00021l-9q for guile-user@gnu.org; Sun, 07 Jul 2019 06:42:21 -0400 Original-Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:37838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hk4cb-0001vN-FB for guile-user@gnu.org; Sun, 07 Jul 2019 06:42:17 -0400 Original-Received: by mail-lf1-x144.google.com with SMTP id c9so7215063lfh.4 for ; Sun, 07 Jul 2019 03:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=l0JnyS8BcJUdmr5IwjfUPliHAyqoWtT0RYanqWDpQKo=; b=RFLGFRwCRPxU1X/HG8ZPNjvgrMVVzQgQE4j30V7yk/keI/0lA5WS01qfxd7gD6Q3FF boU66z3m357DQGE4Sq9ghgKQ50gXmjHvr0RllaQZgQoCxer9QkfzJF1zQCXDVr4rZvJf nNS7R3TLLPjqBEQ9mQpAM7sOIwfwJF4KnDcYT2uPjOUILWr5UKFM6X9gLm/DH3YXCinm jtKljlUKJvTZDzIUJiBSxUeR2d2tMW8kgJ6uV6uUh8tozF2VpudALzalg775wIA5LTZK 1ScjhTm0lMrGyf0O14garwjNFHm5TL4fQ7Np3n73xCeYiVtvMHI0JxnHZPy/Yp0PgZf0 NkXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=l0JnyS8BcJUdmr5IwjfUPliHAyqoWtT0RYanqWDpQKo=; b=KRRnb8rI4SeookBTToDn1Uh5TCQIPUYCRNgsTI17vMl3O32+5+FyfgmuN/dFi0EAOf vD6tzoUt0idB76/uCZ7m5ycz3l3AQHA19/GhW2MsNifBJ3PBR+NPCLNSqxNGfXgwo2oJ eZmflTaYJRQqn46z3P33aT8PYZYSRgwnLG29t/DfXT9WFgaRTj8IXndxqQ4IzMxv0y8F rcmurLY3ME+nK56aULxlzHsNDpUiPhyVWs9/Pu70Mlieoc8zH3jFgjU1p/5PtkPYDdiw FIuIkLHNr1r9BnXWCjc8B/cTW1MhnWLLVQqJsyd9rnvtS6BnM+GGl+0Un+lwONH8Ke2M /sAQ== X-Gm-Message-State: APjAAAUt2chp5EBN3LW27MWkU4BjGN4FcwCNZZQFWKTF6LKvO9QWrVOy nYE/YPbW6Izcxps/LFar6p5NnAaO/0M= X-Google-Smtp-Source: APXvYqzlcuHc71lBU2OVRpOpRFeC29Sor0Chxh81Z+cSnhHr21/Ky8VcwV37lfvYrPT8kEB4kNDglQ== X-Received: by 2002:a19:9c54:: with SMTP id f81mr5910364lfe.146.1562496125237; Sun, 07 Jul 2019 03:42:05 -0700 (PDT) Original-Received: from [10.11.0.6] ([185.65.135.184]) by smtp.googlemail.com with ESMTPSA id m4sm2924742ljc.56.2019.07.07.03.42.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Jul 2019 03:42:04 -0700 (PDT) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::144 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15603 Archived-At: Hi Guile Users! I recently looked at some online course about Elixir and saw an elegant use of pipes (the operator `|>` in Elixir). Then I remembered, that in Racket there are so called threading macros, which seem to accomplish the same: https://github.com/lexi-lambda/threading/blob/master/threading-lib/threading/main.rkt I also searched around for tutorials or explanations on how to write these macros. Sometimes I found excellent documenation in the Chicken Scheme wiki, so I checked there: https://wiki.call-cc.org/eggref/5/pipes However, I would like to use a threading macro or pipes in Guile. I am seeing these options: (1) I could start trying to translate the Racket version to Guile, maybe it would work easily, maybe it uses Racket specific macro stuff, I don't know. However, I am not sure I would learn how the macros actually work. Maybe I would. (2) I could start from zero and try to implement the pipes I saw in the online course about Elixir. (3) Maybe something already exists in Guile, that I am unaware of and could not find through searching. Maybe there are even more names for pipes. So my questions are: (1) Does something already exist? (2) Would translating the Racket version be an easy thing to do, or is there something in there, that cannot so easily be achieved with syntax-parse, syntax-case and the likes? (For someone who rarely touches macros and does not have a lot experience writing them.) Regards, Zelphir