public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Support Iterable in for-each
@ 2014-01-10 18:45 Matthieu Vachon
  2014-01-10 19:24 ` Per Bothner
  0 siblings, 1 reply; 11+ messages in thread
From: Matthieu Vachon @ 2014-01-10 18:45 UTC (permalink / raw)
  To: kawa

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-27 20:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 18:45 Support Iterable in for-each Matthieu Vachon
2014-01-10 19:24 ` Per Bothner
2014-01-10 21:04   ` Jamison Hope
2014-01-10 21:20     ` Per Bothner
2014-01-10 21:27       ` Jamison Hope
2014-01-10 21:27     ` Per Bothner
2014-01-10 21:29       ` Jamison Hope
2015-02-27  2:25   ` Per Bothner
2015-02-27 17:35     ` Jamison Hope
2015-02-27 18:22       ` Matthieu Vachon
2015-02-27 20:43       ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).