Re: Making a jar where the "main" class in manifest is from gen-class

2009-06-19 Thread Eric Willigers
On Jun 20, 3:42 am, "Stephen C. Gilardi" wrote: > One important need filled by gen-class is exactly this case: you need   > a class with a name you can specify completely and use elsewhere. > > > I need to enter the Main class in a jar's Manifest, and was wondering > > how you guys have done it.

Re: What are people using Clojure for?

2009-06-19 Thread Fogus
I've been finding it difficult to work Clojure into the mix at my job due to its Lispiness, therefore my experiences have been isolated to free time hacking. However, I hope to make some headway on getting buy-in on using clojure.jar -- specifically the immutable structs and the Ref class. I was

Re: What are people using Clojure for?

2009-06-19 Thread Berlin Brown
On Jun 18, 12:39 pm, Howard Lewis Ship wrote: > I've been doing a number of presentations on Clojure lately (TheServerSide, > Portland Code Camp, Open Source Bridge), and I'm getting some interest in > Clojure and functional programming. > > A question that keeps coming up is: where would you u

Re: What are people using Clojure for?

2009-06-19 Thread Leonardo Nobrega
I used Clojure recently for prototyping a piece of a face detection system running on Java ME. I had learned a bit of Scheme and wondered if there was already a Lisp implementation for the JVM. A little search and then I found it. When I started playing with it, we could already locate a face in

Re: Which map access is more idiomatic

2009-06-19 Thread Rich Hickey
On Jun 19, 11:13 am, Chouser wrote: > On Fri, Jun 19, 2009 at 3:46 AM, Christophe Grand > wrote: > > > I would further your reasoning on tolerance: it depends on whether the key, > > the map or both are variable. > > (key map) is safe as long as you know that key is a symbol or a keyword. > >

Re: Memory usage in Clojure, hprof

2009-06-19 Thread Berlin Brown
On Jun 19, 1:50 pm, Berlin Brown wrote: > On Jun 19, 1:04 pm, Four of Seventeen wrote: > > > On Jun 19, 10:12 am, BerlinBrown wrote: > > > > 574 instances of class clojure.lang.DynamicClassLoader > > > That is curious. Ordinarily one only needs one instance of any > > particular classloader,

Re: Clojure STM not serializable

2009-06-19 Thread Rich Hickey
On Fri, Jun 19, 2009 at 9:35 AM, Eric Willigers wrote: > > On Jun 18, 9:35 pm, Rich Hickey wrote: >> http://clojure.org/refs >> >> point #8: >> >> "If a constraint on the validity of a value of a Ref that is being >> changed depends upon the simultaneous value of a Ref that is not being >> change

Re: Memory usage in Clojure, hprof

2009-06-19 Thread Berlin Brown
On Jun 19, 1:04 pm, Four of Seventeen wrote: > On Jun 19, 10:12 am, BerlinBrown wrote: > > > 574 instances of class clojure.lang.DynamicClassLoader > > That is curious. Ordinarily one only needs one instance of any > particular classloader, not 574 of them. :) Not that I know much about > cloj

Re: Making a jar where the "main" class in manifest is from gen-class

2009-06-19 Thread Stephen C. Gilardi
On Jun 19, 2009, at 1:02 PM, timshawn wrote: Hello clojure developers, I had a question regarding jar-ring up clojure generated source using gen-class. When I do a gen-class, and say either :main is true, or add a -main method, the class file that gets generated always has a random prefix. O

Re: What are people using Clojure for?

2009-06-19 Thread Howard Lewis Ship
Cascade is coming along: http://wiki.github.com/hlship/cascade I don't have a lot of time to work on it. It's a way to use Clojure earnestly, and hit real world problems, and to learn to think more functionally, in a problem domain I know very, very well. It's an action framework, not a component

Re: Memory usage in Clojure, hprof

2009-06-19 Thread Four of Seventeen
On Jun 19, 10:12 am, BerlinBrown wrote: > 574 instances of class clojure.lang.DynamicClassLoader That is curious. Ordinarily one only needs one instance of any particular classloader, not 574 of them. :) Not that I know much about clojure's internals. --~--~-~--~~~---

Making a jar where the "main" class in manifest is from gen-class

2009-06-19 Thread timshawn
Hello clojure developers, I had a question regarding jar-ring up clojure generated source using gen-class. When I do a gen-class, and say either :main is true, or add a -main method, the class file that gets generated always has a random prefix. I need to enter the Main class in a jar's Manifest

Re: Type hints on primities

2009-06-19 Thread tmountain
I had a feeling I might have been wrong on the primitive hint part. Your explanation makes a lot of sense. Thanks for the clear explanation. Travis On Jun 19, 12:15 pm, Chouser wrote: > On Fri, Jun 19, 2009 at 11:40 AM, tmountain wrote: > > > It looks like Clojure auto-boxes from long to Long b

Re: Type hints on primities

2009-06-19 Thread Chouser
On Fri, Jun 19, 2009 at 11:40 AM, tmountain wrote: > > It looks like Clojure auto-boxes from long to Long by default: > > user=> (type (long 3)) > java.lang.Long Right. > If you want to type hint something to primitive long you'd use #^long. > For object long, use #^Long. Be warned that I'm stil

Re: Type hints on primities

2009-06-19 Thread tmountain
Taken from http://en.wikibooks.org/wiki/Learning_Clojure: Java includes wrapper reference types for its primitive number types, e.g. java.lang.Integer "boxes" (wraps) the primitive int type. Because every Clojure function is a JVM method expecting Object arguments, Java primitives are usually box

Re: What are people using Clojure for?

2009-06-19 Thread rodgertq
We are looking to assess it's suitability for building automated trading systems. Our "pilot" project is an exchange simulator to help automate testing of our existing systems. Tom. On Jun 18, 11:39 am, Howard Lewis Ship wrote: > I've been doing a number of presentations on Clojure lately (The

Re: Clojure STM not serializable

2009-06-19 Thread Eric Willigers
On Jun 18, 9:35 pm, Rich Hickey wrote: > http://clojure.org/refs > > point #8: > > "If a constraint on the validity of a value of a Ref that is being   > changed depends upon the simultaneous value of a Ref that is not being   > changed, that second Ref can be protected from modification by calli

Re: clojure.contrib.*

2009-06-19 Thread cburroughs
If by "the book" you mean Programming Clojure by Stuart Halloway you may want this: http://www.pragprog.com/titles/shcloj/source_code --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: Which map access is more idiomatic

2009-06-19 Thread Chouser
On Fri, Jun 19, 2009 at 3:46 AM, Christophe Grand wrote: > > I would further your reasoning on tolerance: it depends on whether the key, > the map or both are variable. > (key map) is safe as long as you know that key is a symbol or a keyword. > (map key) is safe as long as you know that map will

Type hints on primities

2009-06-19 Thread BerlinBrown
What are the type hints on primitives. For example, long abc = 3 is the type hint #^long or #^Long I also saw use of the java assembly? syntax before: #^[[L? or neither. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: What's the difference between `ref-set` and `alter`?

2009-06-19 Thread Adam Blinkinsop
On Jun 18, 3:34 pm, Rich Hickey wrote: > On Jun 18, 5:23 pm, "Stephen C. Gilardi" wrote: > > On Jun 18, 2009, at 1:25 PM, Adam Blinkinsop wrote: > > > Does ref-set not set the "in-transaction-value"?  It looks like the   > > > only difference is the signature, and that can't be right. > > > Both

Re: clojure.contrib.*

2009-06-19 Thread Stuart Halloway
Hi Justin, The easiest solution is to download the sample code for the book from [1] (this is referenced in the Preface under "Downloading Sample Code"). The sample code includes everything you need: clojure, clojure- contrib, and the book samples, plus launch scripts that get all the clas

Memory usage in Clojure, hprof

2009-06-19 Thread BerlinBrown
This may be a throw a comment, but I was running hprof against this SWT gui application that I have. I have about 10,000 lines of clojure code, so I don't know where to reduce my memory. But I thought these stats were interesting on the number of Clojure objects created. Right now, the apps is e

Re: A Gentle Introduction to Agents

2009-06-19 Thread tmountain
Hi Tim, Thanks for the feedback and for taking the time to read the article. I realized that pmap was probably a better solution as I was writing the code, but pmap doesn't make for much of an agent demo, so I carried on with my original plan. The point you make about bucketing is very interesting

Re: Yet another web framework for Clojure.

2009-06-19 Thread Matt
Never mind.. I talked to a local Ruby guru who explained Rack to me. I went ahead and replaced my Jetty server script with a Ring server script and everything worked. I'm surprised it only took about an hour to do. The Ring adapter and server will be added in the next release. On Jun 19, 8:07 a

Re: How to use primitive array as dispatch value?

2009-06-19 Thread Josip Gracin
On Fri, Jun 19, 2009 at 2:13 PM, pmf wrote: > On Jun 19, 1:31 pm, Josip Gracin wrote: >> How do I dispatch on Java primitive array? I mean, my dispatch >> function is 'class' and I'd like to add method for byte arrays. > > A not very elegant way would be to simply use (class (make-array Byte/ > T

Re: How to use primitive array as dispatch value?

2009-06-19 Thread pmf
On Jun 19, 1:31 pm, Josip Gracin wrote: > Hi! > > How do I dispatch on Java primitive array? I mean, my dispatch > function is 'class' and I'd like to add method for byte arrays. A not very elegant way would be to simply use (class (make-array Byte/ TYPE 0)) as dispatch value, as in the followin

Re: Yet another web framework for Clojure.

2009-06-19 Thread Matt
I do plan on continuing it's development longer term. I have a couple projects which Conjure would work great with. On Jun 19, 7:47 am, rb wrote: > On Jun 18, 11:11 pm, Matt wrote: > > > > > Hi all, > > > I was recently introduced to Clojure by a coworker, and have been > > loving it ever since

Re: Yet another web framework for Clojure.

2009-06-19 Thread Matt
I've taken a look at Ring's Github pages, but I still don't fully understand it. Is there a good tutorial on how to use it, or is it best just to look at example code? On Jun 18, 7:48 pm, James Reeves wrote: > On Jun 18, 10:11 pm, Matt wrote: > > > I've also added a simple hello world tutorial

Re: Loading ImageIcons from clojure code

2009-06-19 Thread Tassilo Horn
pmf writes: Hi! > On Jun 19, 12:52 pm, Tassilo Horn wrote: >>   foo/bar/baz.clj >>   foo/bar/i1.png >>   foo/bar/i2.png >> >> I tried (ClassLoader/getSystemResource "i1.png"), but that looks >> somewhere in the clojure location, not my apps location... > > The right thought, I'm very happy I

Re: Yet another web framework for Clojure.

2009-06-19 Thread rb
On Jun 18, 11:11 pm, Matt wrote: > Hi all, > > I was recently introduced to Clojure by a coworker, and have been > loving it ever since. I jumped in head first writing a Rails like web > framework with it before I realized how many other basic web > frameworks are out there. Anyways, it's a fun p

How to use primitive array as dispatch value?

2009-06-19 Thread Josip Gracin
Hi! How do I dispatch on Java primitive array? I mean, my dispatch function is 'class' and I'd like to add method for byte arrays. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: clojure.contrib.*

2009-06-19 Thread pmf
On Jun 19, 3:11 am, Justin wrote: > Is clojure.contrib.* not included with clojure? No; you need to get it from the git-repository at http://github.com/richhickey/clojure-contrib and build it yourself (and don't forget to include the built JAR in your classpath). --~--~-~--~~

Re: Loading ImageIcons from clojure code

2009-06-19 Thread pmf
On Jun 19, 12:52 pm, Tassilo Horn wrote: >   foo/bar/baz.clj >   foo/bar/i1.png >   foo/bar/i2.png > > I tried (ClassLoader/getSystemResource "i1.png"), but that looks > somewhere in the clojure location, not my apps location... The right thought, but you need to use the full relative path to th

Loading ImageIcons from clojure code

2009-06-19 Thread Tassilo Horn
Hi all, I did some Swing app in clojure. For some JLabels I want to provide an icon, but I cannot load them. In Java the tutorial says I would do class Foo {... new ImageIcon(getClass().getResource("image.png")); } to load the image. The "image.png" is relative to the location of the c

clojure.contrib.*

2009-06-19 Thread Justin
Is clojure.contrib.* not included with clojure? I'm reading the book and in chapter two "re-split" doesnt work for me. I may have missed some instructions- was I supposed to install something else? --~--~-~--~~~---~--~~ You received this message because you are

Re: A Gentle Introduction to Agents

2009-06-19 Thread Timothy Pratley
> Feedback is always welcome. Very entertaining! :) Bucketing is actually counter productive in your example. send already takes care of limiting the active threads by using a thread pool, and can ballance the work better than bucketing. When I run your code unchanged it takes 2400ms, if I set t

Re: Which map access is more idiomatic

2009-06-19 Thread Christophe Grand
Hi, On Fri, Jun 19, 2009 at 1:30 AM, Howard Lewis Ship wrote: > I have code that gets passed a map (actually a struct-map), should I > > (my-map :my-key) > or > (:my-key my-map) > > I'm beginning to gravitate towards the latter, as it is more tolerant of > the map being nil. I would further y

Re: Clojure in "Computing in Science and Engineering"

2009-06-19 Thread Brett Morgan
I'm currently using terracotta as both a message passing fabric in a cluster of four servers, and as a cache to store images and structured information. I'm not measuring performance hit, mainly because the machines i have are seriously over specified for the problem at hand =) On Fri, Jun 19, 200

Re: Clojure in "Computing in Science and Engineering"

2009-06-19 Thread Jon Harrop
On Thursday 18 June 2009 17:48:03 Konrad Hinsen wrote: > The problem is that neither one is particularly well suited for the > majority of scientific applications, which work best on distributed- > memory machines. Of course this may change with the increasing number > of cores-per-processor, shar

Re: Clojure in "Computing in Science and Engineering"

2009-06-19 Thread Konrad Hinsen
On 19.06.2009, at 00:07, Brett Morgan wrote: > Silly question of the week, clojure+terracotta be used to do > scientific cluster computing? The big question is what the performance impact of terracotta is, both for simple but large date (a big array, for example) and for big complex data s