Re: where do you put the docstring in a deftype declaration?

2012-04-12 Thread Frank Siebenlist
Thanks - I kind of expected this - the previous implementation in contrib for 1.2 was based on vars and still shows docstrings in the signature on clojuredocs. There is CLJ-304 "contrib get-source no longer works with deftype" which seems related. Too bad that we cannot annotate deftypes (and

Re: Supporting platform specific code

2012-04-12 Thread Tassilo Horn
Aaron Cohen writes: > I think all your concerns can be addressed by carefully using the > metadata solution? > > ^{:platform :jvm} (load "jvm/lib") > ^{:platform :python} (load "python/lib") But why would that be better than a reader macro #+:jvm(load "jvm/lib") #+:python (load "python/

ANN: Strange Loop 2012

2012-04-12 Thread Alex Miller
--- Strange Loop 2012 St. Louis, MO - Sept 24-25, 2012 Preconference - Sept 23, 2012 http://thestrangeloop.com --- Strange Loop is a multi-technology con

Re: where do you put the docstring in a deftype declaration?

2012-04-12 Thread Alan Malloy
A deftype creates a java class, not a clojure var. Classes have no slots to store a docstring. Just put a comment somewhere. On Apr 12, 9:52 pm, Frank Siebenlist wrote: > Confusingly yours, FrankS. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

where do you put the docstring in a deftype declaration?

2012-04-12 Thread Frank Siebenlist
Confusingly yours, FrankS. -- 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

Re: Supporting platform specific code

2012-04-12 Thread Aaron Cohen
On Thu, Apr 12, 2012 at 11:31 PM, Dave Sann wrote: > -1 for metadata > +1 for file extensions or paths. > > I don't think metadata or in-file conditional compilation is the right > tool for this. > > My reasons are as follows > > 1. I don't think it is a good idea to mix multi-platform definition

Re: [ANN] Leiningen 2.0.0-preview3

2012-04-12 Thread Jacek Laskowski
On Thu, Apr 12, 2012 at 11:39 PM, Michael Klishin wrote: > 1. http://about.travis-ci.org/docs/user/languages/clojure/ I believe it begs for the following change: s/Standalone Leiningen 2.0.0 [preview 2]./Standalone Leiningen 2.0.0 [preview 3]./ in CI environment for Clojure Projects. Jacek -

Re: Supporting platform specific code

2012-04-12 Thread Dave Sann
-1 for metadata +1 for file extensions or paths. I don't think metadata or in-file conditional compilation is the right tool for this. My reasons are as follows 1. I don't think it is a good idea to mix multi-platform definitions in one file. it gets complicated and confusing very quickly. You

Re: Loading a huge graph

2012-04-12 Thread Alex Robbins
Yeah, sounds like it could definitely be a memory issue. This is one part where the JVM works a lot differently than I expected coming from a python background. Everybody may already know this, but the JVM only takes 64mb for the heap by default. You'll get an out of memory error if your program u

Re: Boolean

2012-04-12 Thread Armando Blancas
> > > 'false' is a clojure built-in, > > false and true are JVM built-ins. > LOL. Don't let him get away with anything! -- 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

Re: Supporting platform specific code

2012-04-12 Thread Herwig Hochleitner
As I remember, Rich Hickey solicited input on this matter in his Conj '11 Keynote. Maybe these and other proposals would fit into http://dev.clojure.org/display/design/Cross-Dialect+Enhancements kind regards -- You received this message because you are subscribed to the Google Groups "Clojure" g

Re: Boolean

2012-04-12 Thread mnicky
> > The cheatsheet at http://clojure.org/cheatsheet (and the tooltip variants > available at http://jafingerhut.github.com) link to the clojuredocs > pages, so they have visibility to people who use the cheatsheet, or > clojuredocs.org directly. > > or anyone else who uses this awesome feature

Re: Boolean

2012-04-12 Thread mnicky
The cheatsheet at http://clojure.org/cheatsheet (and the tooltip variants available at http://jafingerhut.github.com) link to the clojuredocs pages, so they have visibility to people who use the cheatsheet, or clojuredocs.orgdirectly. Or anyone else who uses this awesome feature of leinigen 2:

Re: Loading a huge graph

2012-04-12 Thread David Nolen
How much memory do Python & Go consume when you do this? Are you giving the JVM enough memory? On Thu, Apr 12, 2012 at 6:17 PM, László Török wrote: > Hi, > > I'm trying figure out how to load a huge file that contains some 800k pair > of integers (two integers per line) which represent edges of

Loading a huge graph

2012-04-12 Thread László Török
Hi, I'm trying figure out how to load a huge file that contains some 800k pair of integers (two integers per line) which represent edges of a directed graph. So if the ith line has x and y, it means that there is an edge between x and y vertex in the graph. The goal is to load it in an array of

Re: Boolean

2012-04-12 Thread Andy Fingerhut
I know that having such things in the doc strings would probably be your ideal, but note that clojuredocs.org is editable by anyone, and one could in a few minutes create an account there and document what they consider corner cases. I don't know where you'd most like to find these kinds of notes.

Re: [ANN] Leiningen 2.0.0-preview3

2012-04-12 Thread Michael Klishin
Phil Hagelberg: > I'm happy to announce the release of the third preview of Leiningen 2.0.0. lein2-preview3 is already live on travis-ci.org. More about using lein2 in our Clojure guide [1], see [2] if you are only getting started. 1. http://about.travis-ci.org/docs/user/languages/clojure/ 2. h

Re: Supporting platform specific code

2012-04-12 Thread Vinzent
> > And even if it was, why shouldn't I be allowed to build my clojure > projects with ant (like clojure itself) or maven? > Well, theoretically you could be able to do so, but yes, the problem is more fundamental and probably should be solved on a language level rather than one a tooling's one

Re: Boolean

2012-04-12 Thread Vinzent
> > false and true are JVM built-ins. > Yes, but clojure uses this booleans as a basic type, in the same way as it does for lists and symbols. > You could argue the same way that since (1 2 3) and [1 2 3] are equal, > > they represent the same value, and thus you should be able to call > `subv

[ANN]: new library for contract programming

2012-04-12 Thread Vinzent
Hello, I'd like to announce clojure-contracts - a library for contract programming with emphasis on good error messages. In short, it allows you to specify pre- and postconditions for an existing function, and then uses this information to improve

Re: == is not always transitive

2012-04-12 Thread Patrick Houk
Yes, that is one reason why I tend to use BigDecimal instead of float or double. The thing that seems wrong to me is (not (== 1 1.0M)), since these are both exact representations of the value one and the doc for == says that it tests for "equivalent value (type- independent)". On Apr 11, 10:00 pm

Re: Supporting platform specific code

2012-04-12 Thread Tassilo Horn
Vinzent writes: >> Such a feature shouldn't depend on a specific tool, it should be part >> of the language. > > Yeah, you're right - I haven't thought about the fact that leiningen > isn't available on the platforms other than jvm and js. And even if it was, why shouldn't I be allowed to build

Re: Boolean

2012-04-12 Thread Tassilo Horn
Vinzent writes: > As I've mentioned earlier, '(1 2 3) and [1 2 3] is two different > objects, but it's a single value - collection of numbers 1, 2 and 3, > in this order. This is true for all built-in clojure types of data - > equal things are the same thing. No, equal doesn't mean they are the

Re: Supporting platform specific code

2012-04-12 Thread Vinzent
> > Such a feature shouldn't depend on a specific tool, it should be part of > the language. Yeah, you're right - I haven't thought about the fact that leiningen isn't available on the platforms other than jvm and js. Given that reader macros are already used for this purpose extensively in th

Re: Supporting platform specific code

2012-04-12 Thread Tassilo Horn
Vinzent writes: >> I don't think that's too practical. The reader sees the metadata >> only after it already started to read the form it should then ignore, >> if the platform doesn't match. >> > As I understand it happens before compilation (lein plugin extracts > the appropriate forms and then

Re: Accessing defrecord from another namespace

2012-04-12 Thread Vinzent
It should be (ns app.one.a (:require [app.two.b]) (:import [app.two.b Book])) i.e. 'app.two.b' instead of 'ns.app.two.b' пятница, 13 апреля 2012 г., 0:03:49 UTC+6 пользователь Adam Markham написал: > > I have two namespaces as follows: > > (ns app.one.a > (:require [ns.app.two.b]) >

Re: Boolean

2012-04-12 Thread Vinzent
I understand the points you've described, but as I written earlier the thing which is really confuses me is that for 2 equal objects, one considered truthy and the other considered falsey. In terms of clojure, if 2 objects are equal they represents the same value, right? As I've mentioned earli

Re: Supporting platform specific code

2012-04-12 Thread Vinzent
> > I don't think that's too practical. The reader sees the metadata only > after it already started to read the form it should then ignore, if the > platform doesn't match. > As I understand it happens before compilation (lein plugin extracts the appropriate forms and then compiles it), so it

Re: Supporting platform specific code

2012-04-12 Thread Vinzent
> > What we need is even more defined then that, however, Consider this > snippet from core.match: > > (ns clojure.core.match > (:refer-clojure :exclude [compile]) > (:require [clojure.set :as set]) > (:import [java.io Writer])) > > how do we use metadata to restrict/include java.io.Writer v

Re: Boolean

2012-04-12 Thread Tassilo Horn
Vinzent writes: > 1. Clearly state in the section on interop that clojure, unlike java, > doesn't treat 'false' and (Boolean. false) as equal objects. Of course, it does! But `if` doesn't check equality, it checks if the test expression's result is *identical* to nil or false. > 2. Clearly sta

Re: translating underscore.js to clojurescript

2012-04-12 Thread David Nolen
For the curious: https://github.com/Reactive-Extensions/RxJS David On Wed, Apr 11, 2012 at 9:22 PM, Jason Hickner wrote: > Thanks, I'll check it out. > > - Jason > > > On Wednesday, April 11, 2012 4:42:35 PM UTC-7, David Nolen wrote: >> >> It might be worth investigating a more functional solu

Re: Supporting platform specific code

2012-04-12 Thread Tassilo Horn
Vinzent writes: > First thing which comes to mind is to use metadata for this purpose. > Something like > > (defn ^{:platform :jvm} to-string [x] ...) I don't think that's too practical. The reader sees the metadata only after it already started to read the form it should then ignore, if the pl

Re: Supporting platform specific code

2012-04-12 Thread Timothy Baldridge
>> First thing which comes to mind is to use metadata for this purpose. >> Something like >> >> (defn ^{:platform :jvm} to-string [x] ...) > What we need is even more defined then that, however, Consider this snippet from core.match: (ns clojure.core.match (:refer-clojure :exclude [compile])

Re: Boolean

2012-04-12 Thread Vinzent
Well, changing the behaviour of 'if' is not the only way to fix the problem (and it's impossible because of backward compatibility anyway). In my mind, more realistic solution would be: > > 1. Clearly state in the section on interop that clojure, unlike java, doesn't treat 'false' and (Boolean.

Accessing defrecord from another namespace

2012-04-12 Thread Adam Markham
I have two namespaces as follows: (ns app.one.a (:require [ns.app.two.b]) (:import [ns.app.two.b Book])) (def b (Book. "A Book" "Adam")) (ns app.two.b) (defrecord Book [title author]) However whenever I try to import the defrecord I get a ClassNotFoundException thrown. I tried AOT compil

Re: Supporting platform specific code

2012-04-12 Thread Evan Mezeske
> > First thing which comes to mind is to use metadata for this purpose. > Something like > > (defn ^{:platform :jvm} to-string [x] ...) > You might be interested in https://github.com/lynaghk/cljx , which already does this sort of thing. -- You received this message because you are subscrib

Re: Supporting platform specific code

2012-04-12 Thread Jim - FooBar();
+1 for meta-data...it fits the glove perfectly ;-) On 12/04/12 18:52, Vinzent wrote: First thing which comes to mind is to use metadata for this purpose. Something like (defn ^{:platform :jvm} to-string [x] ...) This doesn't force the user to create a separate file for each platform (althou

Re: Supporting platform specific code

2012-04-12 Thread Vinzent
First thing which comes to mind is to use metadata for this purpose. Something like (defn ^{:platform :jvm} to-string [x] ...) This doesn't force the user to create a separate file for each platform (although it's still possible to do so) and feels very naturally for clojure. Another option i

[ANN] Leiningen 2.0.0-preview3

2012-04-12 Thread Phil Hagelberg
Hello folks. I'm happy to announce the release of the third preview of Leiningen 2.0.0. Highlights include the ability to show a full dependency tree a la "mvn dependency:tree", a host of repl improvements, better offline support, and the ability to load "lein new" templates on-demand. * Add HT

Re: Logic puzzle: send more money performance

2012-04-12 Thread David Nolen
You'll want to wait for core.logic to get the cKanren extensions before trying that. Even an optimized core.logic version takes about 14-16s. David On Thu, Apr 12, 2012 at 12:58 PM, Nicolas Buduroi wrote: > Hi, I translated[1]the solution to the "send more money" logic puzzle from > the cKanren

Logic puzzle: send more money performance

2012-04-12 Thread Nicolas Buduroi
Hi, I translated[1]the solution to the "send more money" logic puzzle from the cKanren paper in core.logic and I was wondering about its expected performance. I wasn't patient enough to run it without giving it some clues, giving it the S E N D digits make it run in around 36s on my machine, but th

Supporting platform specific code

2012-04-12 Thread Timothy Baldridge
I've been thinking lately how to seamlessly merge clojure-py and clojure-jvm code in the same packages. This is something I know has been discussed in the past, but I'm just looking for ideas/brainstorming on how we can solve this problem. Let's begin by explaining the problem. Let's assume that m

Re: Comprehensive ClojureScript Optimizations - Please Try!

2012-04-12 Thread David Nolen
On Thu, Apr 12, 2012 at 1:13 AM, Brandon Bloom wrote: > > In my little test project (which depends on Vars for some clever DOM > manipulation callbacks), I needed a way to get the :dynamic flag when > attaching a REPL to an already-compiled front end. What I did was prn the > namespaces atom to t

Re: [ANN] Quil 1.0.0

2012-04-12 Thread Sam Aaron
We have a mailing list (which dates back to the clj-processing days): https://groups.google.com/forum/?fromgroups#!forum/clj-processing I also hang out in #quil on free node. I'm always happy to help out in any way I can. Sam --- http://sam.aaron.name On 11 April 2012 18:04, Changa Damany Ima

Re: Need help to find a bug in a genetic algorithm

2012-04-12 Thread Marcus Lindner
Ahh ok. I had read following text on http://clojure.org/agents "Note that use of Agents starts a pool of non-daemon background threads that will prevent shutdown of the JVM. Use shutdown-agents to terminate these threa