#clojure logs

2008-04-26

01:43gomer-nycHi there
15:08gomer-nyc_Hi
15:09gomer-nyc_Is it possible to supply default values for optional function parameters?
19:12leafwquestion: is there any way to call super.someMethod from a proxied class? The docs say no calls to super. , but there may be other ways perhaps?
19:13leafwthrough reflection, the invoke() would end up invoking the overriden method I think, in any case.
19:25leafwanother question ...
19:25leafwmapping functions to collections is obvious, but to array elements ?
19:25leafwI'd appreciate a hint here
19:34leafwbut the channel is dead. Oh well.
19:48leafwno (seq (make-array (. java.lang.Byte TYPE) 100)) unfortunately ..
20:51leafwhi all
20:51leafwonce more, searching for an answer
20:51rhickeywhat's the question/
20:51rhickey?
20:51leafwI'd appreciate info on whether it's possible at al to map a function to each element of a native array
20:51leafwsuch as a byte[] array
20:52rhickeyin place? no
20:52leafwargh
20:52leafwhow do you approach it then?
20:52leafwlooping ?
20:53rhickeyyou could. or, since map produces a seq, you could turn that into another array.
20:54leafwI'm doing image processing. Duplicating arrays is undesirable (too largE)
20:54rhickeymap-array would be a simple function to write
20:55leafwabout looping ,b ythe way, I can't loop native arrays either - I am not getting the syntax right
20:56rhickeyyou can paste to: http://paste.lisp.org/new/clojure
20:56leafwthanks
20:56leafwlets try
21:00leafwI knowvery little lisp unfortunatley, starting ... so the API (loop [bindings & body]) doesn't get me too far at all
21:00leafwI would expect (loop [i 0 100] ...) where 0=start 100=end
21:05lisppaste8leafw pasted "byte array looping" at http://paste.lisp.org/display/59794
21:05leafwhum nice pastebin system
21:07leafwwhy the pasted code fails is beyond me. (aset pix 10 (byte 14)) works just fine.
21:20rhickey(dotimes i (count pix)
21:20rhickey (aset pix i (byte 42)))
21:21leafwthanks
21:21leafwand why not aset-byte instaed?
21:22leafw(loop [i (- (alength pix) 1)] (aset-byte pix i (byte 14))) seems to work too
21:23rhickeyloop without recur is not right
21:23leafwactually no ... no erro,r byt the pixels are not set.
21:24leafwI see, recur calls he loop agai nwith the iterator manually updated ... urghs
21:26leafwlooks like loop is really a let with a recursion system tied in.
21:26rhickeyyes, it's recursive looping, not iterative looping
21:27leafwa new kind for me.
21:27leafwthanks for helpingout with these basic questions.
21:27rhickeysure
21:30leafwI have built a clojure command line as a plugin inside ImageJ so that I can start learning lisp finally, within the context of my everyday lab problems.
21:31leafwthe very first plugin was a modified version of the temp translator from the website, with propernumber format error checking and hint suggestion.