Re: summing shorts vs summing ints

2011-06-04 Thread Stuart Sierra
you're writing in pure Clojure, try using arrays of `long` instead. If you need to save memory by using `short`, try writing your array-adding method in Java. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: why can't string functions be part of standard clojure lib?

2011-05-21 Thread Stuart Sierra
Thanks for the report. It's already fixed on Clojure master. -S On Saturday, May 21, 2011 2:58:54 PM UTC-4, Tom Hicks wrote: But note that Larry's extra quote came directly from the documentation page he links to. -- You received this message because you are subscribed to the Google Groups

Re: PersistentVector and clojure.lang.Named

2011-05-18 Thread Stuart Sierra
carefully. Oh, and FYI, Clojure is never interpreted. SLIME just invokes the compiler on individual definitions. -Stuart Sierra clojure.com -- 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: Idiomatic way to document defn's

2011-05-13 Thread Stuart Sierra
are just plain text. -Stuart Sierra clojure.com -- 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

Re: Reading clojure code of larger domain specific projects

2011-05-09 Thread Stuart Sierra
-backend -Stuart Sierra clojure.com -- 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: Latest clojure + contrib

2011-05-05 Thread Stuart Sierra
Not all of the new contrib libs have been released yet. For the ones that have been released, you can find the .jar files here: http://repo2.maven.org/maven2/org/clojure/ -Stuart S clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: I am new comer for clojure, I concern that when will clojure surpport Distribution function like erLang

2011-05-04 Thread Stuart Sierra
for notes. Clojure doesn't have a formal roadmap beyond the next release, but future plans will likely involve writing more of the Clojure compiler in Clojure itself, to make it easier to enhance the compiler and port it to other platforms. -Stuart Sierra clojure.com -- You received this message

Re: Declarative Data Models

2011-05-04 Thread Stuart Sierra
. -Stuart Sierra clojure.com -- 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: which is the location for the latest data.finger-tree?

2011-05-03 Thread Stuart Sierra
Yes, that is the latest source. One JAR has been released to the Maven Central Repository: http://repo2.maven.org/maven2/org/clojure/data.finger-tree/0.0.1/ -Stuart S clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread Stuart Sierra
Anything implemented with multimethods (contrib.generic) will be slow compared to primitives and Java methods invoked on primitives. Also try out the better primitive math ops in the 1.3.0-alphas. -Stuart clojure.com -- You received this message because you are subscribed to the Google

Re: Declarative Data Models

2011-05-03 Thread Stuart Sierra
No. Clojure template (which I wrote) is a backwards way of doing macros. It happens to be useful in clojure.test, but nowhere else. -Stuart S clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: clojure.contrib.sql = clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Stuart Sierra
. Both are useful, and I'd like to see versions of all the core functions that support both modes. Thanks for taking this on! -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Clojure 1.2.1 download?

2011-04-17 Thread Stuart Sierra
It will get there eventually... -S -- 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

Re: def and ;dynamic

2011-04-17 Thread Stuart Sierra
1.3 is not even beta yet, so still a long way from final. In the latest snapshots, :dynamic is no longer added automatically, but it still prints a warning. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
If you're referring to clojure-contrib in its current, monolithic form, it is all deprecated. New development is happening in new, per-library repositories at http://github.com/clojure -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups

Re: odd reflection warning

2011-04-15 Thread Stuart Sierra
It's definitely not caused by the generics: they're a fiction of javac, and Clojure ignores them completely. -S -- 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

Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
, string, and test. In new contrib we already have tools.logging, tools.macro, java.jmx, data.json, core.unify, tools.nrepl, data.finger-tree, and data.xml. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: Is this a good idea? (merging let, cond and -)

2011-04-14 Thread Stuart Sierra
any of the (many) implementations of threading operators more complex than the built-in - and -. Also, contrib as a monolithic thing is being phased out in favor of separate repositories dedicated to individual libraries. Stuart Sierra clojure.com -- You received this message because you

Re: Where is the javadoc for clojure.lang ?

2011-04-09 Thread Stuart Sierra
Unfortunately, there is no JavaDoc for clojure.lang because there are no comments in the source. If you want to understand Clojure's Java source code, you'll just have to read it. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure

Re: How to profile my app?

2011-04-07 Thread Stuart Sierra
clojure.contrib.profile is kind of a hack, I wouldn't rely on it for accurate information. -Stuart Sierra clojure.com -- 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

clojure.org domain renewed, waiting for DNS changes to take effect

2011-04-05 Thread Stuart Sierra
The domain was set to auto-renew, there was just a hiccup with our domain registrar. -Stuart Sierra clojure.com -- 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

Re: What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Stuart Sierra
Our registrar failed to get updated billing info; see: https://groups.google.com/d/topic/clojure/Oa37OufE2rA/discussion -- 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: Access static information of records?

2011-04-05 Thread Stuart Sierra
first-class, although I'm not sure if this feature will be included. See http://dev.clojure.org/display/design/defrecord+improvements -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Protocols and name collisions

2011-04-05 Thread Stuart Sierra
You can omit clojure.core/first from your namespace like this: (ns your.namespace (:refer-clojure :exclude (first))) Users of your library could do the same, and also `(:use your.namespace)` to have access to your alternate definition of `first`. -Stuart Sierra clojure.com -- You received

Re: Adding jar to classpath in REPL

2011-04-02 Thread Stuart Sierra
`add-classpath` works only in very limited circumstances. It breaks in most environments that expect to control classloading through other means, like a Java IDE or a servlet container. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups

Re: Basic compilation question

2011-04-02 Thread Stuart Sierra
(fully qualified class name) or lists (package name followed by 1 or more class names). The fact that vectors also work in `import` is an implementation detail and should not be relied upon. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups

Re: int or long as map key

2011-03-30 Thread Stuart Sierra
Looks like that bit is not finished yet. See http://dev.clojure.org/display/doc/Enhanced+Primitive+Support under hash maps and sets now use = for keys -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: using clojure for (java) code generation; advice sought

2011-03-30 Thread Stuart Sierra
Take a look at http://www.stringtemplate.org/ for a Turing-complete, purely-functional, Java-based template language designed for code generation. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: from string to keyword?

2011-03-30 Thread Stuart Sierra
clojure.contrib.json (or the new clojure.data.json) has an option to *not* convert JSON Object keys into keywords. I still think that should be the default, but I was out-shouted. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure

Re: gen-class and state...

2011-03-30 Thread Stuart Sierra
description of what scopes are, much less how to implement them. -Stuart Sierra clojure.com -- 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: int or long as map key

2011-03-26 Thread Stuart Sierra
= (def m {1 10 2 20}) #'user/m user= (m 2) 20 user= (m (long 2)) 20 user= (type 2) java.lang.Long Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Namespace and file structuring

2011-03-25 Thread Stuart Sierra
in the top layer. This helps with the one hard-and-fast rule of Clojure namespaces: no circular dependencies. If namespace A depends on namespace B, then namespace B cannot depend on namespace A. For naming, the Java package convention is pretty good at avoiding conflicts. -Stuart Sierra clojure.com

Re: http://build.clojure.org/releases - no alpha5 alpha6.. ?

2011-03-24 Thread Stuart Sierra
for a list. Old clojure-contrib has not had a release since 1.3.0-alpha4. New releases, to anywhere, are a low priority. -alpha4 is source-compatible with Clojure 1.3.0-alpha6. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group

Re: gen-class and state...

2011-03-24 Thread Stuart Sierra
A typical pattern for resource management is a function or macro like `with-open-file`. -S -- 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: gen-class and state...

2011-03-23 Thread Stuart Sierra
developerWorks: http://www.ibm.com/developerworks/java/library/j-clojure-protocols/#N1058C -Stuart Sierra clojure.com -- 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

Re: Jesus, how the heck to do anything?

2011-03-23 Thread Stuart Sierra
-type projects, but that was a choice made for the other advantages it brings. Thanks, -Stuart Sierra clojure.com -- 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

Re: beginner clojure question: OutOfMemory error processing (slightly) large data file

2011-03-22 Thread Stuart Sierra
with an alternate approach. -Stuart Sierra clojure.com -- 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

Re: beginner clojure question: OutOfMemory error processing (slightly) large data file

2011-03-22 Thread Stuart Sierra
Oh, and the standard JDK class java.util.zip.GZIPInputStream implements gzip decompression. -Stuart Sierra clojure.com -- 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: Reader macro suggestions

2011-03-21 Thread Stuart Sierra
can't really do that in a Lisp syntax, so heredoc usually gets reinterpreted to mean quoted string with multiple characters serving as the delimeter. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: *print-dup* and subvec

2011-03-19 Thread Stuart Sierra
It's a bug: I just created CLJ-761http://dev.clojure.org/jira/browse/CLJ-761 . In general, print-dup should work for serialization, but there are cases where it doesn't work: defrecords, for example, though that may be fixed in the next release. -Stuart Sierra clojure.com -- You received

Re: *print-dup* and subvec

2011-03-17 Thread Stuart Sierra
`print-dup` on any collection type generates code to call the `create` method of the collection's class. `APersistentVector$SubVector` is missing a `create` method. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Emacs slime repl now printing carriage returns after Clojure 1.3.0-alpha5

2011-03-16 Thread Stuart Sierra
Probably swank-clojure. Even better, write an Emacs client for nREPL: https://github.com/clojure/tools.nrepl -S -- 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

Re: xml parsing

2011-03-16 Thread Stuart Sierra
I think xml-seq is returning a sequence representing a depth-first traversal of the XML document. So the first item in the sequence is the entire document, followed by the first element under the root, and so on. -Stuart Sierra clojure.com -- You received this message because you

Re: Evaluation of Symbol Bindings vs. Special Forms

2011-03-14 Thread Stuart Sierra
Yes, with one correction: Clojure is not an interpreter. The Clojure compiler treats certain symbols specially, such as `if`, `do`, and `def`. You cannot redefine these symbols. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure

Re: RuntimeException: Can't embed object in code, maybe print-dup not defined

2011-03-12 Thread Stuart Sierra
exist at runtime. In languages that have a built-in concept of a runtime image, like Smalltalk or some Lisps, the line between static code and runtime data is blurred. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Reference Variables Question

2011-03-12 Thread Stuart Sierra
that the computation happens only once. -Stuart Sierra clojure.com -- 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

Re: How to do replacement operations on trees (nested vectors)?

2011-03-12 Thread Stuart Sierra
Look at Zippers. They can be used to navigate up and down a tree, replacing things as needed. http://clojure.blip.tv/file/4503162/ -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: overriding keyword behavior?

2011-03-11 Thread Stuart Sierra
It is not possible to turn an interface into a protocol. When protocols first appeared, the idea was floated to replace the low-level interfaces like ILookup with equivalent protocols, but this idea has not received substantial attention since. -Stuart Sierra clojure.com -- You received

Re: clojure.string/replace-first return nil when not matched

2011-03-11 Thread Stuart Sierra
(require '[clojure.string :as str]) (str/replace-first abc def #ghi (fn [a] (str a a))) = nil That's a bug. Created http://dev.clojure.org/jira/browse/CLJ-753 http://dev.clojure.org/jira/browse/CLJ-753Thanks for the report. -Stuart Sierra clojure.com -- You received this message

Re: DOM API for Clojure

2011-03-11 Thread Stuart Sierra
It's not the DOM API, but take a look at Zippers as an efficient way to manipulate tree-like structures, including XML. Luke VanderHart's Clojure Conj talk on Zippers is here: http://clojure.blip.tv/file/4503162/ -Stuart Sierra clojure.com -- You received this message because you

Re: DOM API for Clojure

2011-03-11 Thread Stuart Sierra
If you want to receive a DOM object from Java, manipulate it, and then return a DOM object back to Java, without rebuilding it, you're probably stuck manipulating it through the Java DOM APIs. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google

Deleted clojure-1.3.0-testbuild*-SNAPSHOT artifacts

2011-03-11 Thread Stuart Sierra
it, you should no longer see testbuild-* artifacts in your builds. -Stuart Sierra clojure.com -- 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: clojure 1.3 testbuild1, enlive, and dependency ranges

2011-03-11 Thread Stuart Sierra
transitive dependencies with Maven/Leiningen. In Leiningen, like this: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L35 In Maven, like this: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html#Dependency_Exclusions -Stuart

Re: DOM API for Clojure

2011-03-11 Thread Stuart Sierra
was never finished, but you can find video of Rich talking about it here: http://www.infoq.com/interviews/hickey-clojure-protocols And some notes at http://dev.clojure.org/display/design/Mutex+references+%28pods%2C+nee+cells%29 -Stuart Sierra clojure.com -- You received this message because you

Re: clojure 1.3 testbuild1, enlive, and dependency ranges

2011-03-11 Thread Stuart Sierra
I should have mentioned that I had tried both these before posting, and they don't seem to help in this case. All clojure version artifacts were still being downloaded. Huh. That's surprising. Don't know why. *-SNAPSHOT dependency resolution is a bit strange, which is why it's

Re: RuntimeException: Can't embed object in code, maybe print-dup not defined

2011-03-11 Thread Stuart Sierra
that is incorrectly quoted. -Stuart Sierra clojure.com -- 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

Re: with-timeout... ?

2011-03-09 Thread Stuart Sierra
I've been working in this direction with Cljque, for example http://bit.ly/gCtmAl Cljque is still an experiment and has no stable API or documentation. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: overriding keyword behavior?

2011-03-08 Thread Stuart Sierra
Oh yeah, you can't extend an interface to a new class. So it won't work. This is why protocols exist, in fact. Silly me. -S -- 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

Re: Clojure *compile-path* not set properly

2011-03-07 Thread Stuart Sierra
.:clojure.jar clojure.main -Stuart Sierra clojure.com -- 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

Re: 1.3 (inc alpha4)?

2011-03-07 Thread Stuart Sierra
fixing first. -Stuart Sierra clojure.com -- 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

Re: overriding keyword behavior?

2011-03-07 Thread Stuart Sierra
Yes, something like tonyl's code will work. -S -- 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

Re: Web/Screenscraping Library?

2011-03-06 Thread Stuart Sierra
I think you just described strong A.I. -S -- 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

Re: Macro metas (not meta macros)

2011-03-05 Thread Stuart Sierra
foo {:key a} 42) ;; CompilerException java.lang.Exception: ;; Unable to resolve symbol: a in this context (defmeta foo {:key 'a} 42) ^{:key a, ...} #'user/foo Also, look at the source of the defn macro, which quotes the arglist during its expansion. -Stuart Sierra clojure.com

Re: Problem domains for clojure

2011-03-05 Thread Stuart Sierra
Clojure is an excellent choice when you want to integrate with Java libraries, as the interop is almost seamless. As Mike A. mentioned, writing fast numeric algorithms in pure Clojure is tricky, although the next release (currently 1.3.0-alpha) will make that easier, and you can always drop

Re: [Code Bounty] Implementing ClojureScript - command-line/sys-admin scripting with Clojure

2011-03-04 Thread Stuart Sierra
. Many common OS-level features -- launching processes and sending signals, for example -- are not available in the standard Java APIs, and require the use of native code or implementation-specific APIs. I'm not saying it can't be done, just that there may be better tools for the job. -Stuart

Re: trunk

2011-03-04 Thread Stuart Sierra
swank-clojure breaks in a number of small ways on Clojure 1.3 alphas, mostly because of moved/renamed functions. -Stuart Sierra clojure.com -- 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: A blocking function

2011-03-02 Thread Stuart Sierra
Yes, `locking` on the function itself will work; it's roughly equivalent to a `synchronized` method in Java. Also try Agents, as Ken suggests. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: unchecked-divide etc being replaced in 1.3 - no more support for longs?

2011-03-01 Thread Stuart Sierra
The plan is that normal arithmetic functions +-*/ will be fast on longs, and longs will be the default. But I don't know what the plan is if you really do want truncating arithmetic on longs. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Arithmetic operations on custom types

2011-03-01 Thread Stuart Sierra
No, because the arithmetic functions compile down to primitive arithmetic operations. You can define your own generic math functions, but you can't make them as fast as primitives. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure

Re: Transforming map entries

2011-02-23 Thread Stuart Sierra
Reduce! (reduce (fn [new-map [key value]] (assoc new-map ...)) {} old-map) This is nice because you can change both keys and values, even add or remove keys. For something simpler: (into {} (fn [[key value]] ... ) old-map) -Stuart Sierra clojure.com -- You received this message because you

Re: Distributed atom :)

2011-02-23 Thread Stuart Sierra
Tim Dysinger did it with Hazelcast: https://github.com/dysinger/apparatus -Stuart Sierra clojure.com -- 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

Re: ignore-errors

2011-02-23 Thread Stuart Sierra
Clojure itself does not use exceptions for control flow. Java libraries sometimes do. -Stuart Sierra clojure.com -- 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

Re: defrecord/deftype ...

2011-02-18 Thread Stuart Sierra
. Another purpose of defrecord (and deftype) is to support new types that implement protocols. Defrecord adds real type information to maps (accessible through the `type` function) but this was already possible with metadata. -Stuart Sierra clojure.com -- You received this message because you

Re: Java Agent Based Modeling Systems and Clojure

2011-02-18 Thread Stuart Sierra
I don't know much about Agent-Based Modeling, but is it possible you could use Clojure's built-in features, like Agents and Refs, for your application? The old ants demo in Clojure is a simple agent-based simulation. -Stuart Sierra clojure.com -- You received this message because you

Re: defrecord/deftype ...

2011-02-18 Thread Stuart Sierra
persons, but all your maps are now records. -Stuart Sierra clojure.com -- 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: Functional program design concepts

2011-02-18 Thread Stuart Sierra
For examples of polymorphism mixing Java and Clojure, try my article on Developer Works: http://www.ibm.com/developerworks/java/library/j-clojure-protocols/ -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: (identical? foo foo) evaluates to true

2011-02-15 Thread Stuart Sierra
Since about 1.1, I think, the Clojure compiler calls String.intern() on String literals. So yes, they are the same object. -Stuart Sierra -- 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: Stream not closed when reading clojure-version

2011-02-15 Thread Stuart Sierra
This is a bug. I created CLJ-739 for it. http://dev.clojure.org/jira/browse/CLJ-739 Thanks for the report, Olek! -Stuart Sierra clojure.com -- 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: generic (works for any seq) levenshtein distance

2011-02-15 Thread Stuart Sierra
baa) = {:length 3, :indices #{0 6}} -Stuart Sierra clojure.com -- 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: Can gen-class create classes with native methods?

2011-02-14 Thread Stuart Sierra
a package name, but I'm not sure. -Stuart Sierra clojure.com -- 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: Type hinting question

2011-02-14 Thread Stuart Sierra
Thanks, Johan! -S -- 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: free JVMs vs Enterprise JVMs

2011-02-14 Thread Stuart Sierra
, make sure you are familiar with its performance-tuning settings, such as heap size and garbage collection strategy. -Stuart Sierra clojure.com -- 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: Infinite seqs and testing

2011-02-13 Thread Stuart Sierra
Redefining equality is not something to be taken lightly. It can break in subtle ways with identity and hash codes. You may want a custom equality function, like equal up to n elements of a sequence, for use in your tests. -Stuart Sierra clojure.com -- You received this message because you

Re: any good reason why defrecord/deftype doesn't support java class inheritence?

2011-02-13 Thread Stuart Sierra
is bad. It leads to problems like fragile base classes, and (in Java at least) it limits you to a single inheritance hierarchy. Even some Java developers will even tell you to use inheritance only from interfaces, and put shared code into static methods elsewhere. -Stuart Sierra clojure.com

Re: Type hinting question

2011-02-13 Thread Stuart Sierra
Modern JVMs like HotSpot are very good at eliminating unnecessary instructions. Unfortunately, I haven't heard of a good tool for observing this process, so you either have to take it on faith or go read the OpenJDK source code. -Stuart Sierra clojure.com -- You received this message

Re: Handling of unsigned bytes

2011-02-11 Thread Stuart Sierra
Java doesn't have any unsigned types, and that's not really something we can change. Java libraries that need to do binary I/O tend to work with byte arrays and handle individual bytes as ints. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google

Re: Are variadic protocol functions supposed to work?

2011-02-11 Thread Stuart Sierra
It is not supported right now, and probably will not ever be supported. Protocol methods are intended to be a low-level mechanism, with higher-level APIs, including variable arity, built out of ordinary functions. -Stuart Sierra clojure.com -- You received this message because you

Re: Using maven with clojure-contrib 1.3

2011-02-08 Thread Stuart Sierra
Can you give example steps to reproduce this problem? Thanks, -Stuart Sierra clojure.com -- 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: Which branch of clojure-hadoop to use?

2011-02-08 Thread Stuart Sierra
Glad to see there's still interest in this. Sorry I don't have time to maintain clojure-hadoop (I haven't used Hadoop at all in the past year, so I'd be a poor choice) but I will help where I can. If somebody wants to take on maintenance I'll link to it from my github repository. -Stuart

Re: Importing defprotocol and deftype

2011-02-08 Thread Stuart Sierra
`defprotocol` creates a real Var, which you can `use` or `refer` just like a function. `deftype` and `defrecord` both create classes, which you must `import` using the class name. Class names have to be compatible with Java, so dashes are converted to underscores. -Stuart Sierra clojure.com

Re: Hosted REPL, suggestions?

2011-02-03 Thread Stuart Sierra
. https://github.com/clojure/tools.nrepl Anthony Simpson (@IORaynes) started Clojail, a sandboxing library. https://github.com/Raynes/clojail -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: java interop question

2011-02-03 Thread Stuart Sierra
I don't know what select * from StockTick(symbol=... is doing, but it looks like the error is coming from the library handling that query, not Clojure. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: java.io.IOException with compile

2011-02-03 Thread Stuart Sierra
. Or get another operating system. :) -Stuart Sierra clojure.com -- 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: Struct vs. Record: Now and Future

2011-01-30 Thread Stuart Sierra
by the Clojure reader. For more complex data, you probably want a custom format that takes advantage of characteristics of your application's data to achieve better efficiency. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Getting http-agent to throw an exception if url doesn't exist?

2011-01-28 Thread Stuart Sierra
There are a handful of Clojure HTTP libraries on Github, but I do not have one in particular to recommend. It's not hard to use Java's HttpUrlConnection directly. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: How does pmap partition its work?

2011-01-28 Thread Stuart Sierra
David Liebke gave a talk at Clojure-Conj 2010 titled From Concurrency to Parallelism with detailed performance comparisons of map, pmap, and Fork/Join-style iteration. Look for it on clojure.blip.tv in the near future! -Stuart Sierra clojure.com -- You received this message because you

Re: Struct vs. Record: Now and Future

2011-01-28 Thread Stuart Sierra
requested printable/readable defrecords and/or constructor macros. These features may make it into a future release, if we can agree on a consistent design. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: VerifyError trouble

2011-01-28 Thread Stuart Sierra
Hi Eduardo, Are you aware of the :volatile-mutable and :unsynchronized-mutable options in deftype? http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/deftype -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Getting http-agent to throw an exception if url doesn't exist?

2011-01-26 Thread Stuart Sierra
clojure.contrib.http-agent (which I wrote) is deprecated in 1.2 and gone in 1.3. Its design with respect to error handling is fundamentally broken, as you discovered. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Getting clojure projects into maven central - aot vs sources, -javadoc and -sources artifacts

2011-01-26 Thread Stuart Sierra
So far, this hasn't been an issue for contrib, but only a couple of new contrib libraries are releasing to Maven Central right now. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

<    1   2   3   4   5   6   7   8   9   10   >