Re: Clojurians in Prague

2014-09-09 Thread Vincent H
On Tuesday, August 26, 2014 1:41:45 PM UTC+2, DomKM wrote: > > I'm in Prague for a couple weeks. Any locals want to grab a beer and chat > about Clojure[Script]? > There's a meetup tomorrow gathering people interested in FP in general and Clojure in particular. If you fancy, information is the

Re: how do I clojure.string/replace regex characters? Escaping gives me StringIndexOutOfBoundsException

2014-08-04 Thread Vincent H
On Tuesday, August 5, 2014 7:49:21 AM UTC+2, larry google groups wrote: > > I'm working on a website with a frontender who asked to be able to save > JSON maps that contain field names such as: > > "$$hashKey" : "00C" > > The dollar signs are a violation of MongoDB limits on field names, so i >

Re: CLJS Advanced Compilation & JS Libraries lacking externs

2014-03-23 Thread Vincent Seguí
Hi David, Is there a way to output an error if the build does not find the specified extern file? I recently lost more time than I would like to admit to a typo in the extern filename and not getting any error message in the lein build process. -- You received this message because you are sub

Re: range-sum

2014-02-12 Thread Vincent
On Wednesday, February 12, 2014 2:47:07 PM UTC, Stuart Sierra wrote: > > On Wednesday, February 12, 2014 8:46:41 AM UTC-5, Vincent wrote: >> >> On a slightly different topic: why reduce and not apply? >> > > The implementation of `+` with more than 2 arguments uses `

Re: range-sum

2014-02-12 Thread Vincent
On Friday, February 7, 2014 2:23:33 AM UTC, Sean Corfield wrote: > > On Feb 6, 2014, at 12:58 PM, Stuart Sierra > > > wrote: > > I think (reduce + (range N)) is commonly used in **examples**, not > necessarily in real applications. > > > I'd have to agree: I don't see anything like that in our 2

Re: loop/recur with multiple branches

2013-12-11 Thread Vincent Chen
On Tue, Dec 10, 2013 at 11:46 PM, Cedric Greevey wrote: > On Tue, Dec 10, 2013 at 6:29 PM, Vincent Chen wrote: >> >> Try this (not tested, might be missing parens and whatnot): >> >> (defn slice [x s n] >> (loop [[h & tail] x, s s, n n, acc []

Re: loop/recur with multiple branches

2013-12-10 Thread Vincent Chen
accumulator. The accumulator carries the eventual result, which is returned at the base case. - Since we're destructuring into head and tail, I used vectors. conj will push to the end of the vector. - In Clojure, vectors tend to be more natural than lists. Accumulating into lists usually requires a

Re: jdbc timestamp automatic timezone

2013-10-23 Thread Vincent Liard
> > I ended up using a workaround: formatting the timestamps using the > timezone offset. However I'm sure there is a better way. > Thank you Manuel, I didn't find a better way either. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

jdbc timestamp automatic timezone

2013-10-21 Thread Vincent Liard
-21 12:00:00'; timestamp - 2013-02-21 12:00:00 (1 row) clj> (clojure.java.jdbc/query db ["select timestamp '2013-02-21 12:00:00'"]) ({:timestamp #inst "2013-02-21T11:00:00.0-00:00"}) Is there a bug around or am I misunde

Re: Typedef-like functionality for Clojure records?

2013-09-27 Thread Vincent Chen
On Thu, Sep 26, 2013 at 1:49 AM, Marshall Bockrath-Vandegrift wrote: > Vincent Chen writes: > >> - Use something else than records to model structs (suggestions welcome)? > > Maps. > > Records have concrete Java types, which allows them to implement > interfaces a

Re: Typedef-like functionality for Clojure records?

2013-09-27 Thread Vincent Chen
tion and validation you could consider prismatic/schema [1] as a > translation target, and just represent your data with maps. > > [1] https://github.com/Prismatic/schema > > > On Wednesday, September 25, 2013 10:47:35 PM UTC-7, Vincent Chen wrote: >> >> Hi, >> &

Typedef-like functionality for Clojure records?

2013-09-25 Thread Vincent Chen
t extend records syntax/capabilities in the future? - Use something else than records to model structs (suggestions welcome)? - Other? Thanks, Vincent -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: [ANN] XCLJB v0.1.0: X protocol Clojure-language Binding

2013-09-25 Thread Vincent Chen
onvince me otherwise. Thanks, Vincent On Wed, Sep 25, 2013 at 1:50 AM, Adam Clements wrote: > Have you looked at core.async for shuttling asynchronous events back and > forth. This sounds to me like the sort of thing it was designed for > > On 10 Sep 2013 06:30, "Vince

[ANN] XCLJB v0.1.0: X protocol Clojure-language Binding

2013-09-09 Thread Vincent Chen
tching? Is there a better way of implementing events? Regards, Vincent Chen -- -- 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 -

Compiling Clojure security knowledge

2013-09-01 Thread Vincent Ambo
Hej everyone! After a short but interesting discussion on #clojure I'd like to pose some security related questions to a larger audience. This is mostly about user-facing web applications. First some short background: In the main web framework I use, Yeso

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-12 Thread Vincent
On Friday, July 12, 2013 12:01:08 AM UTC+2, Sean Corfield wrote: > > On Wed, Jul 10, 2013 at 11:00 AM, Vincent > > wrote: > > I guess I can proxy APersistentVector, but the Clojure docs [1] advise > to > > use reify in favour to proxy whenever possible. My

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-10 Thread Vincent
my reify. [1] http://clojure.org/datatypes Thanks, Vincent On Tuesday, 9 July 2013 20:40:43 UTC+2, Gary Trakhman wrote: > > From the lack of extending java's Collection in IPersistentVector or > associated interfaces, it seems like the intent is for every implementation > to exten

ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-09 Thread Vincent
osed to write custom implementations of standard interfaces? Should that bug be raised in JIRA? Thanks, Vincent -- -- 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 po

Re: matching, assigning and branching in one form

2013-06-22 Thread Vincent
What about using condp? (condp re-find msg #"^:(.*?)!.*PRIVMSG (.*) :(.*)" :>> #(let [[_ from to message] %] (logic...))) Vincent On Friday, 21 June 2013 17:43:50 UTC+2, Steven Arnold wrote: > > Hi, I am writing a simple IRC bot, pretty much just for fun, sta

Re: NullPointerException when creating protocol in macro

2013-06-07 Thread Vincent
Thanks everyone for your answers. I must say I'm quite mystified as to why Stuart's version works. I ended up defining a function that has the same signature as the protocol, and whose first argument wraps a function that contains the appropriate code. Vincent On Wednesday, 5 June

NullPointerException when creating protocol in macro

2013-06-05 Thread Vincent
achieving what I wanted. I was just wondering if anybody had any opinion or suggestion about that. Am I going off track? Is there a more idiomatic way of doing things that I missed? Thanks, Vincent -- -- You received this message because you are subscribed to the Google Groups "Clojure&q

doubt about clojure.test output

2012-08-18 Thread Vincent
Dear , I am using clojure.test for test in one 'deftest , i had used 3 'is function to assert and in another 'deftest , i had used 5 'is function to assert It ran all test with sucess , but output is Ran 4 tests containing 12 assertions How come 12 ? thank

clojure keyword and mongodb

2012-08-16 Thread Vincent
Dear all , Can one store clojure keyword in MongoDB and get it back as keyword. ? How to store Date type using clojure in MongoDB ? using monger library. thanks in advance Vincent -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: clojurescript and regular expr.

2012-08-12 Thread Vincent
escript uses > Javascript regular expression syntax and not javas > Am 11.08.2012 17:02 schrieb "Vincent" >: > >> dear all , >> i am trying a search a string in a clojure map data and then want to >> return the result to be viewed in webpage >> so using cl

Re: clojurescript and regular expr.

2012-08-11 Thread Vincent
entry))) how to incorporate js code here?> thanks On Sunday, August 12, 2012 12:04:53 AM UTC+5:30, Maik Schünemann wrote: > > Could you please post the relevant code? Note that clojurescript uses > Javascript regular expression syntax and not javas > Am 11.08.2012 17:02

clojurescript and regular expr.

2012-08-11 Thread Vincent
? thanks in advance Vincent -- 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

apply func

2011-09-25 Thread Vincent
I cannot understand why this does'nt work (apply inc [1 2 3 4]) ; apply inc to each vector element while this works (apply println [1 2 3 4]) ;; takes each element and prints it why inc can't take each element and incr it giving the result ... 2 3 4 5 thanks in advance vincen

Re: Clojure in Emacs Seemingly Impossible

2011-09-11 Thread Vincent
+1 -- 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 cl

Re: clojinc: a Clojure tutorial in the form of an extended REPL session

2011-09-07 Thread Vincent
How to use this ? -- 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, s

Re: newbie questions

2011-08-31 Thread Vincent
try out clooj ide ... if never used emacs , -- 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 unsu

online chapters of Practical Common Lisp

2011-08-24 Thread Vincent
will this online http://www.gigamonkeys.com/book/ helpful in clojure/functional programming understanding... thanks vincent -- 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

learning clojure library

2011-08-03 Thread Vincent
func) gives very cryptic document . does not come with example. Thanks in advance Vincent -- 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

Re: JSON library for clojure 1.3

2011-08-02 Thread Vincent
yes ..it is working / great Thanks a lot Vincent -- 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

Re: JSON library for clojure 1.3

2011-08-01 Thread Vincent
how can i test using clooj ide... will lein deps, then run clooj allow me test in repl window -- 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 moderate

Re: Invitation for Open Source Project

2011-07-27 Thread Vincent
right sir -- 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 emai

Re: [ANN] ClojureScript

2011-07-22 Thread Vincent
that means , if i write a clojure program using javax.swing to build windows based appl. manipulating database at backend ( all written in clojure) , this will be converted to javascript and we will be able to run as web appljust as GWT. -- You received this message because you are subscri

Re: [ANN] ClojureScript

2011-07-22 Thread Vincent
What is possible use of ClojureScript ? -- 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 unsubsc

Re: Clojure Books

2011-07-19 Thread Vincent
The Blackstag Blog Post # 5 -> Guide to Programming in Clojure for Beginners -- 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 n

Re: clooj, a lightweight IDE for clojure

2011-07-19 Thread Vincent
nice name ! thanks again for new ide -- 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 unsubscri

Re: How to add jar files to leiningen projects?

2011-07-11 Thread Vincent
can lein do that ? -- 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,

exloring library

2011-06-27 Thread Vincent
start using this library function when slime repl gets connected to swank thru lein? Thanks in advance Vincent -- 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 post

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Vincent
I want to know how to do it with netbeans ide ? any nice step by step instructions will be very helpful , as emacs learning curve and setup is taking much time thanks in advance . vincent -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Question about data structures and encapsulation

2011-06-16 Thread Vincent
nice podcast thanks -- 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 gr

lein and emacs

2011-06-14 Thread Vincent
dependencies and dev depend. 4. run lein deps 5. run lein swank If project already there , then step 2 , step 5 6. in emacs , M-x slime-connect .v Thanks in advance Vincent -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

lein usage

2011-05-20 Thread Vincent
Vincent -- 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, sen

Re: "clojure.lang.PersistentVector cannot be cast to java.lang.String"

2011-05-20 Thread Vincent Liard
At Fri, 20 May 2011 09:59:35 -0400, Ken Wesson wrote: > > On Fri, May 20, 2011 at 9:22 AM, Vincent Liard wrote: > > (defn retailer-stock-update [] > >  (wrap-multipart-params > >   (fn [req] > >     (let [xls (get (:params req) "stock-xls")]

Re: "clojure.lang.PersistentVector cannot be cast to java.lang.String"

2011-05-20 Thread Vincent Liard
At Fri, 20 May 2011 09:55:22 -0400, David Nolen wrote: > On Fri, May 20, 2011 at 9:22 AM, Vincent Liard wrote: > [...] >       (with-in-str [str (:bytes xls)] >         (read-xls-stream str)) > > You usage of with-in-str is not correct, you're passing a vecto

"clojure.lang.PersistentVector cannot be cast to java.lang.String"

2011-05-20 Thread Vincent Liard
can do without explicit call to FileItemStream and FileItemIterator. Anyway, I didn't manage to deal with it either. Could you give me a clue? Thanks in advance, Vincent -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Emacs 23 issues.

2011-04-21 Thread Vincent Liard
t; I have experienced a similar (or the same) problem. I can't find back the appropriate reference, but there is a bug with autodoc in swank-clojure. Try adding (setq slime-use-autodoc-mode nil) to your .emacs Vincent -- You received this message because you are subscribed to the Google Groups

Re: clojure.org

2011-04-05 Thread Vincent Liard
5-Apr-2011 09:34:35 UTC ... That could be why :) Vincent -- 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

map function

2011-03-31 Thread Vincent
Dear all , can this be made better (map keyword (map :tag vector-of-map)) thanks in advance vincent -- 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 n

Re: xml parsing

2011-03-19 Thread Vincent
how to parse such xml and build a defrecord ... any help thanks vincent -- 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 -

Re: xml parsing

2011-03-18 Thread Vincent
how to parse such xml and build a defrecord ... any help thanks vincent -- 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 -

Re: What books have helped you wrap your brain around FP and Clojure?

2009-06-06 Thread Vincent Foley
I recommend "The Little Schemer" and if you want to go further, "The Seasoned Schemer". On Jun 6, 7:12 am, Robert Campbell wrote: > Going beyond the language-specific Programming Clojure book, what > other books have best helped you make the (sometimes mind-bending) > transition from OOP thinkin

Re: Bit-Shift without Sign-Extend?

2009-05-22 Thread Vincent Foley
Like other mentioned in the thread, Java has neither the >>> operator, nor unsigned data types. With that said, I think the function you are looking for is bit-shift- right: user> (bit-shift-right 2r1110 1) 7 I hope this helps. Vincent. On May 21, 9:39 pm, CuppoJava wrote: &

Re: binding inside loop

2009-05-12 Thread Vincent Akkermans
Ah, I see. :) Thanks for your quick reply. Vincent On May 11, 8:54 pm, Rich Hickey wrote: > On May 11, 2:20 pm, Vincent Akkermans > wrote: > > > > > Hi all, > > > I'm building an application in which I want some function calls to be > > logged. Ho

binding inside loop

2009-05-11 Thread Vincent Akkermans
inside the loop. This isn't the expected behavior right? Why is *action-id* sticky?? Vincent --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: java faster than clojure?(probably not)

2009-05-10 Thread Vincent Foley
ng" my reader functions to fns (see compile-field and compile- record in unpack.clj) I hope some of these help. I realize that not all are directly applicable to your case, but I figure other people may find them useful. Cheers, Vincent. On May 9, 6:53 pm, Julien wrote: > I'm in

Re: Git with Google Code

2009-04-29 Thread Vincent Foley
http://article.gmane.org/gmane.comp.version-control.git/117039 On Apr 29, 1:01 am, Dan wrote: > On Tue, Apr 28, 2009 at 4:36 PM, Rayne wrote: > > > Git still sucks on windows :\ > > On which grounds? > > Or as wikipedia would put it [citation needed] --~--~-~--~~~---

Re: The Path to 1.0

2009-04-19 Thread Vincent Foley
For a 1.0 release, I think that having a number that we can point at and say "this software will work with that version of the language" is important. I think a little bit of polish wouldn't be bad either: I saw that Scala ships with bash and batch scripts to launch scala and scalac. I think hav

Re: compare bug?

2009-04-11 Thread Vincent Foley
That's more likely a bug in the documentation that in the compare function. On Apr 11, 4:09 pm, fft1976 wrote: > user=> (doc compare) > - > clojure.core/compare > ([x y]) >   Comparator. Returns 0 if x equals y, -1 if x is logically 'less >   than' y, else 1. Same as Java

Re: A syntax feature request: splitting literal strings

2009-04-04 Thread Vincent Foley
"world" should translate to "helloworld", not "hello world" or "hello world" or "hello\nworld". Vincent. On Apr 3, 11:41 pm, samppi wrote: > I wish I could do this: > > (code... >     "Long error string that doesn't fit

Re: Request for improved error reporting

2009-04-01 Thread Vincent Foley
I have no experience with gradual typing, but I'd love to try it. It seems there are many situations where dynamic typing just makes things easier than in a language like Haskell, however I long for their ability to verify correctness at compile time. Vince On Mar 29, 10:49 am, André Thieme wr

Re: I need help tracking down a performance problem.

2009-04-01 Thread Vincent Foley
(int (~mask-fn (. buf# (~get-fn) > > to be extra safe. > > On Tue, Mar 31, 2009 at 10:00 PM, Vincent Foley wrote: > > > I tried it just now; it made no difference.  Nevertheless, thank you > > for you help and time! > > > On Mar 31, 9:38 pm, Davi

Re: I need help tracking down a performance problem.

2009-03-31 Thread Vincent Foley
  [get-fn mask-fn] >   `(fn [#^ByteBuffer buf# len#] >      (if (= len# 1) >        (~mask-fn (. buf# (~get-fn))) >        (let [#^"[I" arr# (int-array len#)] >          (dotimes [i# len#] >            (aset-int arr# i# (int (~mask-fn (. buf# (~get-fn)) >          arr#

Re: I need help tracking down a performance problem.

2009-03-31 Thread Vincent Foley
>  (aset-int >           arr__2574__auto__ >           i__2575__auto__ >           (mask8 (. buf__2572__auto__ (get) >        arr__2574__auto__))) > > This is the expansion for (make-reader get mask8), where were you attempting > putting the int coercion to to the mask-fn? &g

Re: I need help tracking down a performance problem.

2009-03-31 Thread Vincent Foley
e and there and looking at what happens. On Mar 31, 10:46 am, Christophe Grand wrote: > Did you try to coerce the result of (~mask-fn ...) with int? > (or use aset-int as suggested by David) > > On Tue, Mar 31, 2009 at 4:17 PM, Vincent Foley wrote: > > > No, but in my defense I di

Re: I need help tracking down a performance problem.

2009-03-31 Thread Vincent Foley
No, but in my defense I did not know such a function existed :) I'll give it a whirl and report back! On Mar 31, 9:57 am, David Nolen wrote: > Did you try using aset-int instead of aset? > > On Tue, Mar 31, 2009 at 8:25 AM, Vincent Foley wrote: > > > For those intereste

Re: I need help tracking down a performance problem.

2009-03-31 Thread Vincent Foley
in make-reader? Thanks, Vincent. On Mar 19, 8:12 pm, Vincent Foley wrote: > Hello, > > For the past few days, I've been trying, unsuccessfully, to make an > application I wrote faster.  A Java program that performs, more or > less, the same task takes 12 seconds (on my machine

Re: I need help tracking down a performance problem.

2009-03-23 Thread Vincent Foley
I can try that. More generally, is it possible that I'm just doing this whole thing wrong? That using vectors to represent binary fields and records in a declarative is just a bad idea and that I should try and explore lower- level alternatives? Vincent On Mar 23, 3:35 pm, Christophe

Re: I need help tracking down a performance problem.

2009-03-23 Thread Vincent Foley
s use (apply parse-buffer buf field-vector). Thanks for the assistance, Vincent. On Mar 22, 4:33 pm, Vincent Foley wrote: > How would I do that?  Make a macro that expands into a map literal > with the appropriate calls to .get, .getShort and .getInt? > > On Mar 22, 4:20 pm, Christ

Re: I need help tracking down a performance problem.

2009-03-22 Thread Vincent Foley
How would I do that? Make a macro that expands into a map literal with the appropriate calls to .get, .getShort and .getInt? On Mar 22, 4:20 pm, Christophe Grand wrote: > Vincent Foley a écrit :> The code is available at this > URL:http://code.google.com/p/bwhf/ > &g

Re: I need help tracking down a performance problem.

2009-03-21 Thread Vincent Foley
, I'll look into the improvements you suggested. Vincent. On Mar 21, 9:40 am, Christophe Grand wrote: > Hello, > > Is the java code online somewhere to compare? (Since your code is an > interpreter for byte-fields specs there's a lot of stuff going to read a > single byte,

Re: I need help tracking down a performance problem.

2009-03-20 Thread Vincent Foley
Here: http://gist.github.com/82352 I have posted memory and cpu profiling figures. On Mar 20, 6:56 am, Christophe Grand wrote: > Hello Vincent, > > Vincent Foley a écrit : > > > Hello, > > > For the past few days, I've been trying, unsuccessfully, to make an &g

I need help tracking down a performance problem.

2009-03-19 Thread Vincent Foley
I'm finding the results puzzling: is dereferencing a var *that* expensive? Can anyone tell me if they see something fundamentally wrong with my approach that would explain this abysmal performance? Thank you, Vincent. P.S.: I am using Sun's JVM 1.6.0_10 as shipped in Ubuntu Ibex. My machi

Re: Question about profiling

2009-03-16 Thread Vincent Foley
102% cpu 2:41.10 total Java: % time java -server -cp . hu.belicza.andras.bwhf.control.BinRepParser ~/prog/clojure/clj-starcraft/misc/replays/*.rep 1047 java -server -cp . hu.belicza.andras.bwhf.control.BinRepParser 12.92s user 0.31s system 110% cpu 11.923 total On Mar 16, 9:41 pm, Vincent Fo

Re: I got to use Clojure at work today !!!

2009-03-16 Thread Vincent Foley
Personal project at work, or part of something bigger? On Mar 16, 9:27 pm, Jeffrey Straszheim wrote: > Only to do a tiny little test w/ not-deployed code.  But still: I am a > professional Clojure developer now :) > (Please don't kill my dream.) --~--~-~--~~~---~--~--

Re: Question about profiling

2009-03-16 Thread Vincent Foley
Java 1.6.0_07 for Hardy vs Java 1.6.0_10 for Ibex. However, with this newer package, the Java program is now more than 13x faster than my Clojure program. Looks like I got a lot of work ahead of me. Vincent. On Mar 16, 9:31 pm, Jeffrey Straszheim wrote: > Are they both Java 6?  I know

Re: Question about profiling

2009-03-16 Thread Vincent Foley
I found that the problem is caused by the version of Sun's JVM on Ubunty Hardy Heron. On my Ibex machine at home, the first two lines (Object.wait and ReferenceQueue.remove) are not even there and the costliest method if AtomicInteger.get. Vi

Question about profiling

2009-03-16 Thread Vincent Foley
for 66% of my runtime and how I could avoid this overhead? The AtomicInteger.get also intrigues me. My code is available at the following address if you need to see it: http://bitbucket.org/gnuvince/clj-starcraft/src/ Thank you, Vincent. --~--~-~--~~~---~--~~ You

Qi's type system

2009-03-15 Thread Vincent Foley
to it than "it would be nice"? Vincent. --~--~-~--~~~---~--~~ 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 grou

Re: Static type guy trying to convert

2009-03-10 Thread Vincent Foley
With Clojure you don't need to understand Monads. And I don't think they're hard to understand, I think they're hard to come to grips with because of what they are capable of. Anyway, I hope you enjoy Clojure :) On Mar 10, 11:30 am, zoltar wrote: > Thanks everyone! That gives me a lot more con

Re: Static type guy trying to convert

2009-03-10 Thread Vincent Foley
to mention that I'm also a fan of static typing and that to this day, I still don't know whether I prefer the freedom and flexibility of dynamic typing or the constraint and safety of static typing. Be safe, Vincent. On Mar 10, 1:16 am, zoltar wrote: > Hey everyone. I've be

Re: Would people be interested in extending test-is with random tests?

2009-02-23 Thread Vincent Foley
I'm definitely interested. There is Fact that does this already as well as ClojureCheck (http://bitbucket.org/kotarak/clojurecheck/ overview/). I think you should try to contact James and Meikel and see if it would be a good idea to join forces. I don't mind multiple libraries that do the same

Re: alternate syntax

2009-02-23 Thread Vincent Foley
way? It's the same as in Java except you move the opening parentheses to the left of the function name (and with Clojure, you don't even need to remove the commas!): foo(bar, baz) => (foo bar, baz) Vincent. On Feb 23, 10:42 am, Mark Volkmann wrote: > I have an idea I'd like to

Re: :use feature requests

2009-02-23 Thread Vincent Foley
Stuart is gonna love you guys ;) On Feb 23, 2:59 pm, Chouser wrote: > On Mon, Feb 23, 2009 at 2:33 PM, Stephen C. Gilardi wrote: > > > > > > > At that point, it seems only a small step to remove "require" entirely which > > I think would be a long-term plus--coalescing two very similar things >

Re: Should (pop nil) throw an exception?

2009-02-22 Thread Vincent Foley
You would not be able to distinguish between an empty collection and pop returning a nil value. On Feb 21, 4:28 pm, Frantisek Sodomka wrote: > Hello! > Currently, 'pop' throws an exception if the collection is empty: > > clojure.core/pop > ([coll]) >   For a list or queue, returns a new list/que

Re: Contributors and community

2009-02-20 Thread Vincent Foley
. Congratulations on your success Rich, may it continue for years to come. So say we all! Vincent. On Feb 20, 2:59 pm, Rich Hickey wrote: > There have been many new additions to the contributors list: > > http://clojure.org/contributing > > and many new donations: > > ht

Re: Possible bug in sorted-set, question about comparisons

2009-02-20 Thread Vincent Foley
I'm pretty sure that sorted-set works only with values that are instances of a class that implements Comparable. user=> (instance? Comparable []) true user=> (instance? Comparable {}) false user=> (instance? Comparable ()) false user=> On Feb 20, 2:21 pm, Frantisek Sodomka wrote: > sorted-set

Re: Newbie: Where is clojure.jar?

2009-02-19 Thread Vincent Foley
Run ant On Feb 19, 4:00 pm, samppi wrote: > So I've downloaded the latest, lazier version of Clojure. But I'm > having trouble; there used to be a clojure.jar file in the folder, and > it's not there anymore. The distribution's readme.txt still says: "To > Run java -cp clojure.jar clojure.lang.R

clojure.contrib.math: lcm

2009-02-19 Thread Vincent Foley
I've added a lcm function the clojure.contrib.math. I sent my CA form to Rich this afternoon. Where should I submit the patch? (is it possible to attach it using the Google groups interface?) Vincent --~--~-~--~~~---~--~~ You received this message becaus

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-15 Thread Vincent Foley
so it wouldn't be completely foreign. Vincent. On Feb 15, 12:18 pm, Rich Hickey wrote: > I'm pretty much finished with the fully-lazy implementation and am > happy so far with the results. I think this will be an important > addition to Clojure and am planning to add it. >

Re: count-leaves from onLisp question

2009-02-15 Thread Vincent Foley
Sorry about the erroneous function, I think this is more likely what you want: (defn count-leaves [[left & right :as tree]] (if (seq tree) (+ (if (sequential? left) (count-leaves left) 1) (count-leaves right)) 0)) user> (count-leaves []) 0 user> (count-leaves [

Re: count-leaves from onLisp question

2009-02-15 Thread Vincent Foley
Oh duh, I didn't even implement the correct thing! Sorry :( On Feb 15, 11:06 am, Vincent Foley wrote: > I'm not sure if it's "Clojury", but this seems to work: > > (defn count-leaves [tree] >   (if (sequential? tree) >     (+ (count-leaves (first

Re: count-leaves from onLisp question

2009-02-15 Thread Vincent Foley
I'm not sure if it's "Clojury", but this seems to work: (defn count-leaves [tree] (if (sequential? tree) (+ (count-leaves (first tree)) (count-leaves (rest tree))) (or tree 0))) user> (count-leaves [1 2 3]) 6 user> (count-leaves [1 [2] 3]) 6 user> (count-leaves []) 0 On Feb 15,

Re: Reflection warnings starting at r1265

2009-02-13 Thread Vincent Foley
Thanks Rich! On Feb 13, 10:01 am, Rich Hickey wrote: > On Feb 13, 9:06 am, Vincent Foley wrote: > > > Should I add this to the list of issues in the Google Code tracker? > > No. Those hints were suspect to begin with. > > .get returns a byte already, and .getShort

Re: Reflection warnings starting at r1265

2009-02-13 Thread Vincent Foley
Should I add this to the list of issues in the Google Code tracker? Vincent. On Feb 12, 4:15 pm, Vincent Foley wrote: > Hello, > > I was surprised today to see that my Starcraft replay program became > slower when I updated my Clojure working copy.  About a week ago, > Chouser h

Re: loop [#^Integer c 0] vs. loop [c (int 0)] and optimization question...

2009-02-13 Thread Vincent Foley
Dimiter, The latest revision of Clojure is r1278; are you using the Google code trunk? Vincent On Feb 12, 5:35 pm, "Dimiter \"malkia\" Stanev" wrote: > Hi guys, > > I'm optimizing a little benchmark called pnpoly, and I was wondering > what is the proper

Reflection warnings starting at r1265

2009-02-12 Thread Vincent Foley
Hello, I was surprised today to see that my Starcraft replay program became slower when I updated my Clojure working copy. About a week ago, Chouser helped me adding type hints to avoid reflection in my functions. The warnings came back today. I started going through the different revisions of

Re: is mod correct?

2009-02-11 Thread Vincent Foley
tes toward 0. Vincent. [1] http://www.haskell.org/ghc/docs/6.8.3/html/libraries/base/Prelude.html On Feb 10, 8:34 pm, Timothy Pratley wrote: > I spoke too soon. Apparently from the Lisp HyperSpec > mod performs the operation floor on number and divisor and returns the > remainder o

  1   2   >