From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 10733 invoked from network); 26 Apr 2020 22:06:35 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 26 Apr 2020 22:06:35 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 070369C986; Mon, 27 Apr 2020 08:06:32 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 49B6F9C95E; Mon, 27 Apr 2020 08:06:03 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 24DB79C95E; Mon, 27 Apr 2020 08:06:00 +1000 (AEST) X-Greylist: delayed 374 seconds by postgrey-1.36 at minnie.tuhs.org; Mon, 27 Apr 2020 08:05:59 AEST Received: from cfcl.com (cpepool4cmts2-144.sanbrunocable.com [24.143.248.144]) by minnie.tuhs.org (Postfix) with ESMTP id 26D3B9C95A for ; Mon, 27 Apr 2020 08:05:59 +1000 (AEST) Received: from spot.local (spot.local [IPv6:fe80::1c0d:8a40:1437:1275]) by cfcl.com (Postfix) with ESMTP id D3E86D6AD1A for ; Sun, 26 Apr 2020 14:59:44 -0700 (PDT) From: Rich Morin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Date: Sun, 26 Apr 2020 14:59:43 -0700 References: <20200425180357.A004918C0B6@mercury.lcs.mit.edu> <20200426193704.GA87816@clarinet.employees.org> <20200426201044.GB87816@clarinet.employees.org> To: The Unix Heritage Society mailing list In-Reply-To: <20200426201044.GB87816@clarinet.employees.org> Message-Id: <9EE9F12A-F44F-4BB8-B859-9D77AF46F4EF@cfcl.com> X-Mailer: Apple Mail (2.3608.40.2.2.4) Subject: Re: [TUHS] v7 K&R C X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" > On Apr 26, 2020, at 13:10, Derek Fawcus wrote: >=20 > I guess I'd have to question why someone would wish to write such a = construct, > as error handling seems awkward. FWIW, I do most of my programming these days in Elixir. It's a = functional programming language with pervasive pattern matching, Rubyish syntax, = and Lispish macros. It runs on the Erlang virtual machine, so it has a good story for Actor-based concurrency, distribution, etc. For details, see: https://en.wikipedia.org/wiki/Elixir_(programming_language) Anyway, compilation is mostly handled by Lispish macros, so it can = support some fairly cool metaprogramming. In particular, I can write things = like: out_map =3D inp_list |> Enum.filter(filter_fn) |> Enum.map(map_fn) |> Enum.reduce(%{}, reduce_fn) Piped values are handed in as the first argument to each function and = most functions expect this behavior. For extra credit, there is a set of = Stream functions (really, macros) that process one element at a time and handle errors in a reasonable manner. -r