On May 8, 12:54 am, CuppoJava <patrickli_2...@hotmail.com> wrote:
> Thanks Meikel.
> That certainly works. But don't you find:
>
> (for [:while (Mouse/hasEvent)] (Mouse/getEvent))
>
> much shorter and easier to understand?
I don't, really. for is a list comprehension, and so it needs
bindings... Something to generate the list from.
Also, how is a lazy sequence of mouse events supposed to work? does it
block? What happens when there is no mouse event? does the sequence
just end? What if you happen to take the last event, and then the
sequence ends, after which another event comes in? for wouldn't know
what to do in the general case.
Anyway, I don't think it's worth the trouble; it's not especially
functional style either. If you need such a construct, I believe it
would be best to make a new function, with a more fitting name.
--
Jarkko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---