From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21267 invoked by alias); 10 Jan 2014 18:45:07 -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 21255 invoked by uid 89); 10 Jan 2014 18:45:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f45.google.com Received: from mail-wg0-f45.google.com (HELO mail-wg0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 10 Jan 2014 18:45:06 +0000 Received: by mail-wg0-f45.google.com with SMTP id n12so870516wgh.24 for ; Fri, 10 Jan 2014 10:45:02 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.79.106 with SMTP id i10mr4049119wix.23.1389379502444; Fri, 10 Jan 2014 10:45:02 -0800 (PST) Received: by 10.216.204.65 with HTTP; Fri, 10 Jan 2014 10:45:02 -0800 (PST) Date: Fri, 10 Jan 2014 18:45:00 -0000 Message-ID: Subject: Support Iterable in for-each From: Matthieu Vachon To: "kawa@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-q1/txt/msg00003.txt.bz2 Hi Per, I was wondering if you think it would be possible for the `for-each` methods and friends to accept directly a Java `Iterable` object. That would greatly ease Java usage since it would not be necessary in a lot of cases to transform an `Iterable` to a native list. However, I fear that it would not be that easy because maybe a lot of stuff relies on car/cdr. But we could make them compatible with `Iterable` though, where `car` returns first element from `Iterable` object and `cdr` returns an `Iterable` representing the rest elements and for a single element list, returns maybe an empty `Iterable`. But this would implies some more logic changes on `null?` and maybe other methods so it's possibly far-fetched and potentially a BC break (I don't think so but it may be the case). Of course, I could have my specialized function of `for-each` and like to do the job, but I think having "native" support if possible is always better. Had you had some thoughts on this subject before? Regards, Matt