Re: What is this notation? "-a"

2021-12-26 Thread William la Forge
https://stackoverflow.com/questions/10846423/is-there-a-clojure-convention-for-naming-private-functions/10853372 On Saturday, December 25, 2021 at 6:53:56 PM UTC-5 hank@gmail.com wrote: > Hello -- > > Sometimes I see a notation that uses a prefix "-", as in: > > user> (def -a (atom [])) > #'u

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread LaurentJ
Hank, Just a message to give you the solution [spoiler alert] Don't read it, if you still want to search :) SPOILER SPOILER ;; ugly version using the fact that java objects are mutable in place (defn ugly-read-chars-one-by-one [reader] (let [sb (StringBuilder.)]

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread LaurentJ
Hi Hank, That loop/recur is still wrong because `loop` set bindings to define names and gives initial values but `recur` does *not set bindings*, it just provides new values. So `recur` does not need a vector of bindings like `loop` The pattern is as follow: (loop [a-local-var "initial-value"

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread Hank Lenzi
Hi -- Thanks for taking the time to help me. As far as I understand the examples, loop has this template: loop [binding] (condition (statement) (recur (binding))) And in 'recur' the loop is re-executed with new bindings. There was indeed an issue with the 'recur' outside 'when'. T

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread LaurentJ
Hank Your loop/recur in your pt5 function is still not good. Take the time to read the loop/recur documentation and to understand examples. A Clojure loop/recur is not really a loop like in other procedural languages. It is more akin to a new function call at the `loop` point with new args pro

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread LaurentJ
Hi, In the quoted example the `recur` call is *inside* the `when` which is a huge difference because there is in this case an halting condition to get out of the loop ;) regards Laurent Le dimanche 26 décembre 2021 à 14:41:15 UTC+1, hank@gmail.com a écrit : > 2021-12-25, 21:11:46 UTC-3, La

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread Hank Lenzi
2021-12-25, 21:11:46 UTC-3, LaurentJ wrote: "Hi, Your loop/recur usage is wrong, your error may be because your loop has no halting condition." Hi Laurent -- I actually took inspiration from one of the sources you posted: (import '(javax.sound.sampled AudioSystem AudioFormat$Encoding)) (let [mp

Re: Pesky java interop bug with 0xFFFFFFF error in BuferredReader

2021-12-26 Thread Hank Lenzi
Thanks, Harold. You see, that was an exercise in Java interop - I know about slurp, but I was trying to understand what was going on there. -- Hank -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro