Hi All,

I want to turn a clojure sequence into an 'EventStream' java interface in 
clojure 
(see 
http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html).
 
Basically this is an object that implements next() and hasNext() methods.

I know this can be done with proxy:

(proxy [EventStream] []
   (hasNext [] ...)
   (next [] (Event. ...) ...))

What I am not sure about is how to deal with state. More precisely, the 
object returned by the above call to proxy obviously must somehow keep a 
pointer to the current position in the input sequence and increment the 
index after a call to next() etc.

Any ideas on how to best do something like this?

Thanks a lot!
Joachim. 
   

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to