This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: list comprehension patterns
- From: Andrea Bernardini <andrebask at gmail dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: Kawa mailing list <kawa at sourceware dot org>
- Date: Thu, 18 May 2017 23:58:51 +0100
- Subject: Re: list comprehension patterns
- Authentication-results: sourceware.org; auth=none
- References: <b2a8af4c-ccd2-0d32-ea2a-bba00277fd36@bothner.com>
Quite interesting article, I found some minor typos/issues
* Where you say Kawa-specific "|" do you mean Kawa-specific "!" ?
* There is a repetition in this sentence "A "scan context" is is an expression"
* "and then result sequence is "spliced" into its context." You meant
"and the result"?
* Another repetition and the sentence is not completely clear "When in
the scope of two more more distinct scan variables then are scanned
"in parallel""
* I think what you call outer join should be called Cartesian product
or cross join
Regarding the hypothetical filtering syntax
(! [a ...] A #!if (P a))
what about using one of 'when', the first is inspired by the single
branch if in Racket (where the 'if' keyword is replaced by when).
(! [a ...] A when (P a))
Also 'where' or 'on' could be possibilities.
The ellipsis syntax is nice, however when more scan patterns are
nested together can be confusing, have you considered using two dots
instead of three
#|kawa:31|# (define (fun2 [[x ..] ..] [y ..])
#|.....32|# [[(+ x y) ..] ..])
just thoughts
Cheers,
Andrea
On 17 May 2017 at 18:00, Per Bothner <per@bothner.com> wrote:
> I posted a new blog article:
> http://per.bothner.com/blog/2017/list-comprehension-patterns/
>
> Feedback welcome.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/