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

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

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

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: 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

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: 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: 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: 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: 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 -

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

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

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

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

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.

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: 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,

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: 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: [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: [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: 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: 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: 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

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

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

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

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

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

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

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

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

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: 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

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: Modulo

2008-12-28 Thread Vincent Foley
I suppose then that we would also need div. Using GHCi here: Prelude> (-3) `div` 2 -2 Prelude> (-3) `quot` 2 -1 On Dec 22, 7:04 am, "Mark Engelberg" wrote: > Anyone know why there is no modulo or mod function in Clojure's core? > I know there is a rem function, but that's not the same thing.

Re: How can I be useful to Clojure?

2009-01-12 Thread Vincent Foley
If you have a blog, you may certainly write about your experience, the difficulties you encountered learning the language, etc. This can provide valuable help to other new users as well as give an indication of what the documentation should cover. On Jan 12, 4:21 am, HB wrote: > Hey, > I would

Re: Clojure now running in production

2009-01-13 Thread Vincent Foley
As this is a commercial project, I imagine you are quite limited in what you can tell us, but I'd love to hear about the issues you faced during development. On Jan 13, 10:38 am, Luc Prefontaine wrote: > Hi everyone, > > as of yesterday pm, Clojure is running in a live system in a big > veterina

Re: Programming Clojure Beta 5 is Out

2009-01-13 Thread Vincent Foley
Well, I've gone ahead and finally bought it. Here I thought I would have time to read a fiction novel or something :) On Jan 13, 12:02 pm, Stuart Halloway wrote: > http://blog.thinkrelevance.com/2009/1/13/programming-clojure-beta-5-i... > > Cheers, > Stu --~--~-~--~~~---

Re: No Indentation in SLIME

2009-01-15 Thread Vincent Foley
nt) Hope this helps. Vincent On Jan 15, 2:27 am, Kyle Smith wrote: > Hello, > > I'm new to Clojure, SLIME, and emacs in general but I've noticed my > SLIME REPL does not indent properly when I use or C-j. This > is the error message I see: > > "calculate-li

Re: Problem using fn macro

2009-01-15 Thread Vincent Foley
When you're using fn as a parameter name, you are shadowing the fn special form. Like Mark Volkmann said, it is best that you refrain from using special form names and core macros and functions names to name your own things. f is the prefered notation to name a function passed to another functio

Re: Streams work

2009-01-21 Thread Vincent Foley
I have a question regarding the examples, specifically map* and filter* (defn map* [f coll] (let [iter (stream-iter coll)] (stream (fn [eos] (let [x (next! iter eos)] (if (= eos x) x (f x))) (take 4 (map* inc (filter* even? (range 100 -> (1 3 5 7) How is e

Re: Streams work

2009-01-21 Thread Vincent Foley
(do (println eos) eos) x)) #'user/s user=> (seq s) (0 1 2 3 # 4) Vincent On Jan 21, 7:59 pm, Rich Hickey wrote: > On Jan 21, 7:40 pm, Vincent Foley wrote: > > > I have a question regarding the examples, specifically map* and > > filter* > &g

greatest and least

2009-01-21 Thread Vincent Foley
A couple months ago, there was a discussion in this group about the functions max and min and making them work with data types other than numbers. I was toying around tonight, and I wrote the following functions. (defn- boundary [compare-fn f & args] (reduce (fn [a b] (if (compare-fn (compar

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread Vincent Foley
The only two false values in Clojure are false and nil. Everything else is logically true. If your function returns nil/false or a result, you don't need (not (nil? (...))) On Jan 23, 2:59 pm, BerlinBrown wrote: > Here is some code, my question relates to '(not (nil?...': > >  (if (not (nil? (

Re: Not nil and 'true' with conditional functions

2009-01-23 Thread Vincent Foley
The return value of a function is the return value of its last expression. On Jan 23, 3:17 pm, wubbie wrote: > Is every function supposed to return something? > Of course, except for pure side-effects. > > -sun > > On Jan 23, 3:02 pm, Vincent Foley wrote: > > > T

Re: what's the difference between when and if?

2009-01-24 Thread Vincent Foley
when is like do with only the 'then' branch wrapped in a do: (if foo (do (println "hi") 42))) is the same as (when foo (println "hi") 42) And like if without an else branch, when returns nil if its predicate yields false. On Jan 24, 9:33 am, wubbie wrote: > Here is code from co

Re: greatest and least

2009-01-24 Thread Vincent Foley
g addition to clojure-contrib? Vincent. On Jan 21, 11:09 pm, Vincent Foley wrote: > A couple months ago, there was a discussion in this group about the > functions max and min and making them work with data types other than > numbers.  I was toying around tonight, and I wrote the fo

Re: A case when do suppresses exception?

2009-01-24 Thread Vincent Foley
It's the laziness; because the value of the call to map is never consumed, it is never produced either, so the throw never happens. On Jan 25, 1:05 am, Kei Suzuki wrote: > Form3 makes me puzzled. Form1 and Form2 throw exception as expected. > Why doesn't Form3? > > Form1: (do ((fn [] (throw (Exc

Re: greatest and least

2009-01-26 Thread Vincent Foley
ommon to want to find only one greatest/least element, this would also quickly become an annoyance to users. Any comments or thoughts? Vincent. On Jan 24, 6:57 pm, Vincent Foley wrote: > I've worked on the library today, and imported it into a GitHub > project:http://github.com/

Re: repeat and replicate

2009-01-28 Thread Vincent Foley
repeat returns an infinite seq; replicate returns a finite one. On Jan 27, 8:53 pm, Shawn Hoover wrote: > Why do we have both repeat and replicate? I can sort of keep them straight, > but as they only differ by arity I wonder if they can be combined... or if > I'm missing a subtle reason for sep

Re: nested maps

2009-01-28 Thread Vincent Foley
(-> person :employer :address :city) would be my pick Vincent On Jan 28, 4:02 pm, Mark Volkmann wrote: > I have a map that describes a person. > It has a key that describes their address. > It also has a key for their employer. > The employer has its own address. > > (d

Downloading the Java SE API documentation

2009-02-01 Thread Vincent Foley
a way to download it. Does anyone know where I could get it in HTML format? 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@g

Re: New York Hadoop User Group, Feb. 10

2009-02-05 Thread Vincent Foley
Do you have slides for those of us who cannot attend? On Feb 5, 12:33 pm, Stuart Sierra wrote: > Hello, New York!  If you're interested, I'm presenting at the New York > Hadoop User Group [1] next Tuesday, February 10, at 6:30. > > I'll talk about using Clojure with Hadoop, among other things. >

Re: What profilers are you using?

2009-02-06 Thread Vincent Foley
I don't know much about Java profiling, but I've been using java - Xprof and java -Xrunhprof, and it's usually been enough to guide me. On Feb 5, 10:47 pm, Sergio wrote: > I have been trying out the YourKit profiler and I think it's great. > However, my evaluation license is going to expire soon

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

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: 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

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: 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: 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: 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
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: 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. >

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: 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

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: 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: 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: :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: 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: 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: 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: 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

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

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

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

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: 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
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

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: 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

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-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-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-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-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-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
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
>  (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
  [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-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: 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: 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: 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: 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: 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: 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

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: 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

  1   2   >