Re: Not so happy with my code

2010-04-18 Thread verec
Posted too quickly ... replace "ana3" with "anagram". I cleaned-up the code before posting, forgetting that the previous version "ana3" was still in the REPL ... Oh well ... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Not so happy with my code

2010-04-18 Thread verec
I have two problems with the following code. First, I have this `tos' business (to-string) because: user=> (first "abc") \a user=> (rest "abc") (\b \c) Since I wanted to get strings out of strings, a character or a collection is no good. Second, I ended-up having to use a mutable atom `res' becaus

Re: ?: create static inner Java class with constructor argument

2010-04-12 Thread verec
You may also want to browse this thread: http://groups.google.com/group/clojure/browse_frm/thread/a80e0767566357e5/224909f792464f6d -- 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 tha

Re: STM and Garbage Collection

2010-04-03 Thread verec
The two issues are orthogonal. Even if Clojure had been going for full copies to preserve immutability, the reason why the "old" copy would leak is only because your code would hold a reference to it. With structural sharing, those bits of "old" that are still retained in "new" are precisely thos

Re: Transcript of Rich's "Clojure for Lispers" talk uploaded

2009-08-22 Thread verec
First paragraph, first TBD: "Hi. I'm here to talk about Clojure, which I've done several times, and never ... oh, yeah, once, at the European (TBD something that sounds like "cover less") workshop, for an audience of Lispers, but" European Common Lisp Workshop :-) -- JFB On Aug 13, 9:40 pm, A

Re: Newbish question. Does anyone have any example code for playing a wav sound file?

2009-07-28 Thread verec
Got to admit that I had a bit of a fight with the imports and the line that reads: (. javax.sound.sampled.LineEvent$Type STOP) Your solution/syntax with (LineEvent$Type/STOP) is a clear winner! :-) Thanks. On Jul 28, 9:23 am, Michael Wood wrote: > 2009/7/28 verec : > > >

Re: Newbish question. Does anyone have any example code for playing a wav sound file?

2009-07-27 Thread verec
vent$Type STOP))) (.close clip) (.close stream) (try (.open clip stream) (.start clip) (catch Exception e nil (simple-play (URL. "file:///Users/verec/Tools/workspace/BetfairV6_new/ resources/com/mac/verec/betfair/sounds/tinkalink2.wav")) --

IEEE Computer Society endorsing Clojure

2009-07-19 Thread verec
http://www2.computer.org/portal/web/computingnow The article: http://www2.computer.org/cms/Computer.org/ComputingNow/homepage/2009/0709/rW_CS_TrailblazingwithRoadrunner.pdf top of page 95, right column. :-) -- JFB --~--~-~--~~~---~--~~ You received this message

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-23 Thread verec
A bit facetious, I know, but a not too sarcastic pun on the current economic climate ... foreclojure :-) Has good Googleability too :-) On Jun 23, 5:21 pm, Laurent PETIT wrote: > What about eclipjure ? > > 2009/6/23 Christophe Grand > > > > > On Tue, Jun 23, 2009 at 5:56 PM, Laurent PETIT >

Re: Clojure at JavaOne

2009-05-18 Thread verec
Whatever you chose, you probably ought to show its source with an IDE (whichever you chose: NetBeans. Eclipse, IntelliJ) but should probably forget about emacs: many (most?) Java developers won't even consider anything that isn't at least partially integrated within some IDE. Not sure how much wo

Re: How to build tree with nodes that 'point' to each other?

2009-02-12 Thread verec
You night want to consider this: user=> (def m {:myself nil :yourself 'moo}) #'user/m user=> m {:myself nil, :yourself moo} user=> (def m2 (assoc m :myself m)) #'user/m2 user=> m {:myself nil, :yourself moo} user=> m2 {:myself {:myself nil, :yourself moo}, :yourself moo} Now, if :myself' value w

Re: London Clojurians

2009-02-02 Thread verec
Count me in :) -- JFB --~--~-~--~~~---~--~~ 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...@g

Re: RFC: new clojure.set functions

2009-01-31 Thread verec
I'm must be missing something obvious for the [s1 s2] case of union: Is it only that you've measured (conj s1 s2) to be faster when s2 is the smallest ? (defn un ([s1 s2] (reduce conj s1 s2)) ... ) user=> (def a #{1 2 3}) user=> (def b #{4 5 6 7}) user

Re: Functional way to implement a VM?

2008-12-22 Thread verec
The design simplicity is certainly very appealing, though it appears that you can only operate on a predetermined fixed set of "registers" (ie: a and b in your example) and would need to define as many add_, sub_, mul_ ... variants as there are 'registers' in your model. Also, simple arithmetic s

Re: recur rationale?

2008-12-21 Thread verec
> You propose a clever trick, but unfortunately it would require even   > more cleverness. What if foo, bar, and baz live in different   > libraries, and you reload one of the libraries as part of a dynamic   > update at runtime? How would the inline copies know they needed to   > update? Annotat

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 3:20 pm, verec wrote: > Though I wonder how complicated it would be to "coalesce" any such > set of mutually recursive functions into a single "JVM method" where > such "local gotos" bytecodes exist and are documented -- that's w

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 3:03 pm, "Christian Vest Hansen" wrote: > On Sat, Dec 20, 2008 at 3:29 PM, verec > > When they don't apply. As I understand things, this magic > transformation would have you think that clojure has true TCO, when > the tail-call -> recur transfo

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 2:46 pm, Randall R Schulz wrote: > On Saturday 20 December 2008 06:29, verec wrote: > > > I'm just curious about examples where such a "magic transformation" > > would result in violated assumptions. > > Write some Clojure code and use recur f

recur rationale?

2008-12-20 Thread verec
At about 72:54 of the clojure sequence talk, Rich explains that he doesn't want to provide "false guaranties" to people used to "true tail calls" even though he could detect such "tail position calls" and basically transforms them into what recur currently does. I'm just curious about examples wh

Re: Improved Maven Build

2008-12-04 Thread verec
+1 (avoid Maven, drop pom) I'm just out of a project that has used Maven for more than 18 month. The pain and frustration caused by the slowness and compexity of Maven's "download the whole internet" approach can be matched only bu the willingness of team astronauts to introduce Maven plugins in

Re: French translation of the Clojure rationale

2008-11-23 Thread verec
> Cela dit, au cours des derniers mois je me suis tenu dans des groupes > de discussions de programmation francophones et j'ai découvert qu'un > nombre assez important de gens sont soit très mal à l'aise en anglais > ou y sont carrément hostiles. Ne pas vouloir utiliser l'Anglais pour l'informati

Re: French translation of the Clojure rationale

2008-11-21 Thread verec
Je ne peux que louer l'effort et surtout éviter de décourager les bonnes volontés, mais le résultat est si verbeux et si proche de ce qu'on peut lire en informatique en Français, que je ne peux que douter très fort de l'impact d'une telle traduction. Je n'ai jamais cru un seul instant qu'une lang

Re: Eclipse Plugin- any plans for this?

2008-11-21 Thread verec
I'm still active on this, as I'm sure Casey is. Though the recent crop of incompatible changes means some rework as the target is moving :) -- JFB On Nov 21, 1:03 pm, MikeM <[EMAIL PROTECTED]> wrote: > This came up on the list not long ago, don't know what the status is: > > http://code.google.co

Re: Namespaces and distinctness

2008-11-19 Thread verec
> The reason why is the first part of your domain is > unimportant and possibly likely to change. Much in the same way we have: java.lang.Math ... and ... com.sun.awt.AWTUtilites, or, even "better": com.sun.org.apache.* :-) :-) :-) :-) --~--~-~--~~~---~--~~ Yo

Re: doseq, dotimes & loop/recur

2008-11-08 Thread verec
> > To rephrase the question differently, what could exist that is not a > > clojure `seq' that we would want to iterate over? > > > Clojure already answers this (partially?) by providing (dotimes ...) > > (as CL does) to iterate over a zero based consecutive and finite > > sequence of numbers. Th

Re: doseq, dotimes & loop/recur

2008-11-08 Thread verec
Hmmm. Thank you for the post. Questions of laziness apart, I know that recursion has been proven to be equivalent to iterations (expect to weed out interview candidates, as per Steve Yege's remarks :-) But then why would we want any of `doseq', `dotimes' or `doall', and if we do, is that set co

doseq, dotimes & loop/recur

2008-11-08 Thread verec
More of an inquiry into the "fp mindset as opposed to the procedural one" than anything else ... If I got this right, there are two forms of iterations: internal and external. `map' is an "internal iterator", `doseq' is an "external iterator". An "internal iterator" does the iteration "by itself

Re: Clojure ant target version

2008-10-26 Thread verec
Given the total lack of generics use in the code (did someone notice a that I missed :-) and the fact that java.util.concurrent.* originated as a separate, non core java library, you might as well want to specifiy 1.4 ... Just kidding, of course ... What's wrong with 1.6? Even us in OS X land ha

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread verec
French expat, London, UK On Oct 17, 10:27 am, "Rastislav Kassak" <[EMAIL PROTECTED]> wrote: > Hello Clojurians, > > I think after 1st year of Clojure life it's good to check how far has > Clojure spread all over the world. > > So wherever are you come from, be proud and say it. > > I'm from Slova

Re: (exit)

2008-10-04 Thread verec
with a nicer (defn exit "Returns to the OS by forcibly exiting the platform" ([& code] (. System exit (or code 0 Still puzzled as to why boot.clj needs to be passed as argument from the command line, since it seems loaded anyway, seemingly from clojure.jar ... --

(exit)

2008-10-04 Thread verec
OK. That one with trivial to add :-) (defn exit "Returns to the OS by forcibly exiting the platform" ([] (. System exit 0)) ([n] (. System exit n))) Added inside boot.clj, right before (import '(java.io Writer)) (defn- print-sequential [#^String begin, print-one, #^Str