[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how useful are collecting lists?
- To: dwheeler@xxxxxxxxxxxx
- Subject: Re: how useful are collecting lists?
- From: David Vanderson <david.vanderson@xxxxxxxxx>
- Date: Tue, 12 Mar 2013 18:30:10 -0700
- Cc: srfi-110 <srfi-110@xxxxxxxxxxxxxxxxx>
- Delivered-to: srfi-110@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Id/IDifhHXOQu3b7RAyWQZ5oFInkTx/YPNhObW3qzkk=; b=JEpbYgUCMPmSY1f2cgTPSCcseHEj+uZ4+YpvrwBIZ4XurOAgzcq569eQ1TdwFGpxUi v9VT2cTzIAio+i4fulPY80BvjO7w92KkDOAip6Gj54G/fY8e1KuA+OJAK7GQV9+G8esC kRXUETg33syGsJDPu+rNh/UlgdU6QiJsUXonTiCbHVp8pGJdNwFL93DAttk2WTIdmtfM aIFcDiSV/rqlqnj0ump/DerdTzPixXR7YdTO0aGF9x49M56K4usLliKS9LKD14ao9Wrf FLONNBu9LaJ5ZgmdQsgZKQfKSLP8a9sQr6aZHZOZSVjMzHNnBDFvWB8iCzkfdShaQ9FH MF4A==
- In-reply-to: <E1UFYz2-0001Am-U6@xxxxxxxxxxxxxxxxx>
- References: <513EAE55.80204@xxxxxxxxx> <E1UFYz2-0001Am-U6@xxxxxxxxxxxxxxxxx>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3
On 03/12/2013 04:51 PM, David A. Wheeler wrote:
That makes sense - AmkG also noted how recently they were added. It
would be great to have a few more examples in the SRFI.
Collecting lists are the most recent addition to the notation,
and were added after sweeten and letterfall were written.
So they're unused for simple reason that, at the time, they didn't exist.
That said, I could go back to "sweeten" and add a few uses of
collecting lists, to show their use in practice. Sounds reasonable enough,
at least to demonstrate utility.
The rationale for collecting lists is here:
The rationale notes two use cases:
1. A long sequence of definitions contained within an initial statement. This situation occurs in many library definition structures such as Scheme R7RS define-library and in some larger data structures.
2. A let-style statement with one or two variables with short initial values.
I think #1 is a decent rationale, and with some experimenting I'm
starting to see how collecting lists are useful there. To make sure I
understand, it seems like the primary motivation here is the
"unintentional blank line" problem:
This works in a Python script, but not at the REPL. To avoid that
behavior, when using sweet expressions you either have to remove blank
Or you must manually insert \\:
Are those the only options without collecting lists? If so, I can
understand the motivation.
In my examples, define has an implicit begin. In this situation, I'm
unsure how to use <*, because it introduces an extra parenthesis. Have
you run into this problem?
The second rationale for collecting lists (short multi-value let
expressions) seems much less obvious to me, especially since the
alternates given in the SRFI don't look particularly annoying. I would
suggest reducing the emphasis on it in favor of #1, but am unsure how
the SRFI process works. Would you be open to a suggested rewriting of
Thank you for the readable project!