From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122329 invoked by alias); 20 May 2017 21:03:02 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 122299 invoked by uid 89); 20 May 2017 21:03:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=inspired, scanned, rare X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 20 May 2017 21:03:00 +0000 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dCBWe-0003Td-Vg; Sat, 20 May 2017 23:03:01 +0200 Received: from 64-118-118-90-rt-broadband-00.broadband.oakhurst.sti.net ([64.118.118.90] helo=localhost.localdomain) by mailfront11.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1dCBWb-0004eY-6A; Sat, 20 May 2017 23:02:57 +0200 Subject: Re: list comprehension patterns To: Andrea Bernardini Cc: Kawa mailing list References: From: Per Bothner Message-ID: <1081fbfb-a9f0-360a-8694-925d466640a3@bothner.com> Date: Sat, 20 May 2017 21:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00074.txt.bz2 On 05/18/2017 03:58 PM, Andrea Bernardini wrote: > 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"? Oops. Fixed. > * 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"" Re-phrased. > 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. Yes, those are all possible. Note that Scheme generally does not use identifiers this way, with rare exceptions (such as 'else' in 'case'). We also have to be careful about parser ambiguities, as well as robustness when it comes to errors. I think the decision will come down to what filtering syntax works best with cross product. > 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) ..] ..]) I don't think that helps any. The key thing to note is that we're using '...' *exactly* the way '...' is used in R5RS syntax patterns and templates (except not in a macro-definition context, of course). So using '...' makes a lot of sense. -- --Per Bothner per@bothner.com http://per.bothner.com/