Re: Docs on standard protocols

2012-11-26 Thread Stuart Sierra
Unfortunately, I am not aware of any comprehensive documentation for the internal Java implementation of Clojure's core data types. The source code is the only definitive resource. Introspection can help. For example, to get a list of everything you need to implement to support map-like

Re: Clojure expression benchmarks

2012-11-25 Thread Stuart Sierra
Thanks for putting this together, Andy! It's great to have this data. -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

Re: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Stuart Sierra
*print-dup* tries to preserve type information. That's why it emits constructor functions with #=. You can still use 'pr' with *print-dup* set to false, which is the default. You get machine-readable data of the correct abstract type, e.g. list/vector/map/set, but you lose type information

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-20 Thread Stuart Sierra
`lein trampoline` was required to permit the CLJS REPL process to grab STDIN/STDOUT. According to a recent thread on the Leiningen mailing list, this may have been fixed in the Git master branch of Leiningen. -S -- You received this message because you are subscribed to the Google Groups

Re: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Stuart Sierra
`spit` calls `str` on its argument, which has the same behavior as `print` or `println` with regard to quoting strings: user= (println I say, \Hello, World!\) I say, Hello, World! nil To preserve data in its `read`able form, you need `pr` or `prn`: user= (prn I say, \Hello, World!\) I say,

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-19 Thread Stuart Sierra
A long time ago I posted some macros to do double-dispatch with protocols and records. The link was http://paste.lisp.org/+2023 but it no longer works. The basic idea is you dispatch on the first argument to an intermediate type that then dispatches on the second argument. It's complicated,

Re: explicit progression-of-time constructs? (wikipedia)

2012-11-18 Thread Stuart Sierra
I expect the Wikipedia article is referring to Clojure's mutable reference types -- Ref, Atom, Agent, Var -- which help to manage state that changes over time. See also http://clojure.org/state and http://clojure.org/concurrent_programming -S -- You received this message because you are

Re: Are agents suitable for c10k concurrency?

2012-11-18 Thread Stuart Sierra
What matters is the I/O framework. You'll want to use a non-blocking network library, then you should be able to use `send` rather than `send-off`. `send` uses a fixed-size thread pool for all Agents in the system. That said, while I believe Agents are a suitable solution to this problem,

Re: CLJS-418: Unspecified dependency on google-closure-library-third-party

2012-11-17 Thread Stuart Sierra
The real question I'm hoping somebody can answer is: what changed to cause this? The G.Closure library or ClojureScript? -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

Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-16 Thread Stuart Sierra
Tracking this at http://dev.clojure.org/jira/browse/CLJS-418 -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

CLJS-418: Unspecified dependency on google-closure-library-third-party

2012-11-16 Thread Stuart Sierra
http://dev.clojure.org/jira/browse/CLJS-418 We currently distribute the Google Closure Library in two separate JARs: the main library and the third-party extensions. We do this because the third-party extensions are covered by different licenses. But, as it turns out, various classes in the

Re: CLJS-418: Unspecified dependency on google-closure-library-third-party

2012-11-16 Thread Stuart Sierra
I should mention, there's an easy temporary fix: just add the third-party library as a dependency in your project: ;; In :dependencies vector of Leiningen's project.clj [org.clojure/google-closure-library-third-party 0.0-2029] -S -- You received this message because you are

Re: freeing resources while generating lazy sequences

2012-11-16 Thread Stuart Sierra
Lazy sequences do not interact well with resources that need to be closed. This is a long-standing issue, and no universal solution has been found. The usual recommendation is to manage the resource in a higher scope than the process that uses it. In your case, rather than creating the iterator

Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-13 Thread Stuart Sierra
My original reason for splitting the third-party JAR was the licensing: the main G.Closure library is under the Apache license; the third-party libraries are under a variety of different licenses. One simple solution would be to make ClojureScript itself have a dependency on the third-party

Re: How to get the namespace for an unqualified symbol?

2012-11-12 Thread Stuart Sierra
Assuming the symbol is bound to a Var, you can do this: (name (ns-name (:ns (meta (resolve 'x) -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

Re: lein-midje-lazytest

2012-11-11 Thread Stuart Sierra
Hi, I have not continued development of Lazytest, but I took most of the code-reloading parts and refactored them into tools.namespace 0.2.x: https://github.com/clojure/tools.namespace tools.namespace might make a better foundation for a development tool. Thanks for your interest in Lazytest.

[ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-11-09 Thread Stuart Sierra
ClojureScript release 0.0-1535 is out. Get it in Leiningen: [org.clojure/clojurescript 0.0-1535] Change log for this release: http://build.clojure.org/job/clojurescript-release/19/ This release depends on the latest version of the Google Closure Library, r2029. You can also depend on it

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-09 Thread Stuart Sierra
On Thursday, November 8, 2012 4:14:03 PM UTC-5, Robert Pitts wrote: Awesome. Would you say that this is essentially a completed work? Growing weary or reading and re-reading beta books lately. Yes, the book is finished and out of beta. There may still be periodic updates and bug fixes to

Re: gen-class with :extend and overloaded methods in superclass

2012-11-07 Thread Stuart Sierra
Hi Bartek, In this case, I don't think `gen-class` has any part to play at all. All `gen-class` does is generate a class with stub methods that dispatch to Clojure functions by name. What matters is an expression like `(.f this a)`. If the Clojure compiler can statically determine the types

Re: with-open and line-seq

2012-11-07 Thread Stuart Sierra
On Wednesday, November 7, 2012 2:29:06 PM UTC-5, Jim foo.bar wrote: This is exactly the approach I'm taking...'doall' retains the head so with massive files it will break...'doseq' will not. at least this is my understanding... That is correct. `doall` retains the head because it returns

[ANN] new book: ClojureScript: Up and Running

2012-11-07 Thread Stuart Sierra
Not to toot our own horn, but people have been asking about getting started with ClojureScript, so here's our contribution, just released in book form: ClojureScript: Up and Running by Stuart Sierra and Luke VanderHart published by O'Reilly in paper, eBook, and Safari http://shop.oreilly.com

Re: Java-to-Clojure source translation?

2012-11-05 Thread Stuart Sierra
On Sunday, November 4, 2012 4:18:27 PM UTC-5, Vladimir Tsichevski wrote: That's why I'm looking for means which could HELP me rewrite my code base to Clojure, not to produce compilable and runnable code. Just parse Java syntax tree and pretty-print it back as Clojure-like text. Even if

Re: impossible to create classes for non-closure environment

2012-11-04 Thread Stuart Sierra
Hello, Clojure (by the way, it is not spelled closure) is not really designed to generate pure-Java classes. `gen-class` is slightly more flexible than `deftype`, but it will still generate references to Clojure classes. If the structure of your Java classes is defined by interfaces, `deftype`

Re: Java-to-Clojure source translation?

2012-11-04 Thread Stuart Sierra
Hello, It is not really possible to make a direct translation from Java to Clojure. Java has mutable variables and imperative flow-control, for which there is no equivalent in Clojure. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Clojure CA over email thread on clojure-dev

2012-10-31 Thread Stuart Sierra
The discussion on the clojure-dev list is not about *if* CAs will be accepted electronically, but *how*. Stuart Halloway requested help finding examples of the processes that other organizations have developed for receiving contributor agreements. In particular, he wanted to know if some large

Re: clojure.org requires more clicks now

2012-10-28 Thread Stuart Sierra
Hello Heinz, I'm sorry you're finding navigation difficult on Clojure.org. I agree that fewer clicks are better, but we (me, Stuart Halloway, and a few others) felt that the site was getting cluttered with too many links, which was confusing to newcomers. It would be nice if the Documentation

Re: with-open and line-seq

2012-10-28 Thread Stuart Sierra
On Friday, October 26, 2012 11:11:48 PM UTC-4, daveray wrote: I guess I looking for a magical line-seq that closes the file correctly even if you consume part of the sequence, is resilient to exceptions, etc, etc. I realize that it might be impossible, so I asked. :) It's been discussed

ANN: data.json 0.2.1 and tools.namespace 0.2.1

2012-10-27 Thread Stuart Sierra
[org.clojure/data.json 0.2.1] * restores deprecated API functions from 0.1.x releases * recommended over 0.2.0, which broke code that depended on the old API [org.clojure/tools.namespace 0.2.1] * minor bugfix * restores deprecated API functions from 0.1.x releases * recommended over

Re: ANN: data.json 0.2.0

2012-10-26 Thread Stuart Sierra
It is done. data.json 0.2.1 coming to a repository near you. http://build.clojure.org/job/data.json/77/ https://github.com/clojure/data.json/tree/data.json-0.2.1 -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: ANN: data.json 0.2.0

2012-10-25 Thread Stuart Sierra
I am not opposed to having a shim to support an API compatible with older releases. It's not even particularly difficult: https://gist.github.com/3950124 I certainly did not anticipate this release causing significant problems for application or library developers, and if it did then I

Re: ANN: data.json 0.2.0

2012-10-25 Thread Stuart Sierra
I'm sorry for causing people extra work. How's this for a solution: https://github.com/clojure/data.json/commit/6ee71009946731d89ef8f98e7b659fa82443b6a2 This allows the 0.2.x code to pass all the tests for data.json 0.1.3. I can't retract the 0.2.0 release, but if I push this out as 0.2.1 the

Re: [ANN] nrepl.el 0.1.5 released

2012-10-24 Thread Stuart Sierra
Thanks so much for working on nREPL.el, Tim. -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

ANN: data.json 0.2.0

2012-10-19 Thread Stuart Sierra
https://github.com/clojure/data.json Highlights: - New API - Customizable type conversion functions - big int and big decimal support - Performance improvements -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

ANN: ClojureScript release 0.0-1513

2012-10-19 Thread Stuart Sierra
ClojureScript release 0.0-1513 is on its way to the Maven Central Repository. Changes: http://build.clojure.org/job/clojurescript-release/18/ -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Replacing nested let statements with assignments

2012-10-18 Thread Stuart Sierra
It's slightly different, but libraries such as Flow or Prismatic's Graph can be used to achieve a similar effect. Flow: https://github.com/stuartsierra/flow Graph: http://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.html Example using Flow: (def the-flow (flow b

Re: Correct usage of data-readers

2012-10-16 Thread Stuart Sierra
- is it appropriate to include data_readers.clj in a library - given that file is in the root? No. data_readers.clj is intended for application developers. Libraries may define data reader functions and suggest tags for consumers of that library. -S -- You received this message because you

Re: Smarter code reloading with tools.namespace 0.2.0

2012-10-16 Thread Stuart Sierra
#FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/tools/namespace__init.class or *clojure/tools/namespace.clj* on classpath: Now, somewhere in the code, something is looking for clojure.tools.namespace.clj. But that's just a directory in the

Re: Correct usage of data-readers

2012-10-16 Thread Stuart Sierra
One data_readers.clj file can't override another: it's an error if they contain the same tags with different functions. So if a library defines its data reader tags, you can't override them *at read-time* in your app. You can always override readers dynamically at run-time by binding

Re: Smarter code reloading with tools.namespace 0.2.0

2012-10-16 Thread Stuart Sierra
'ring-devel' depends on 'ns-tracker', which uses tools.namespace 0.1.3: https://github.com/weavejester/ns-tracker/blob/master/project.clj Dependency resolution will only allow one version of the library, so your project gets tools.namespace 0.2.0, not 0.1.3. The two releases are not compatible,

Re: where is pvmap?

2012-10-14 Thread Stuart Sierra
pvmap never made it into the main branch. The new 'reducers' library in Clojure 1.5 takes its place. -S On Saturday, October 13, 2012 9:50:23 AM UTC-4, Jim foo.bar wrote: I am struggling to find the namespace in which 'pvmap' lives! Can anyone help? Jim -- You received this message

ANN: ClojureScript release 0.0-1503

2012-10-14 Thread Stuart Sierra
Available in the Maven Central Repositories: http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1503%7Cjar Complete change log: http://build.clojure.org/job/clojurescript-release/17/ Leiningen dependency information: [org.clojure/clojurescript 0.0-1503] -S --

Re: Intern a var from outside namespace

2012-10-12 Thread Stuart Sierra
Sounds like a load-order issue. Make sure the code *creating* the namespaces/vars is loaded before the code *using* them. But better yet, just don't do it. :) -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Bug in printing futures

2012-10-12 Thread Stuart Sierra
Patch welcome. -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: Question on mandatory arguments for - and - macros

2012-10-12 Thread Stuart Sierra
Thank you, especially thanks for tagging it an enhancement. -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

Re: concat files after pmap

2012-10-12 Thread Stuart Sierra
You could use clojure.java.io: (require [clojure.java.io :as io]) (defn cat-files [output-file input-files] (with-open [stream (io/output-stream output-file)] (doseq [file input-files] (io/copy (io/file file) stream -S -- You received this message because you are subscribed

Re: bug in clojure.lang.ASeq

2012-10-10 Thread Stuart Sierra
I would recommend serializing as strings via pr/read over Java serialization, but this still sounds like a legitimate bug. -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: understanding 'binding' use in clojure.java.jdbc

2012-10-10 Thread Stuart Sierra
On Tuesday, October 9, 2012 10:25:05 PM UTC-4, Sean Corfield wrote: This is why c.j.jdbc is getting an API overall that will expose functions that accept the connection or the db-spec directly (and the old API will be rewritten in terms of the new one for compatibility). Excellent. -S

Re: adding clojure.test/assert-expr methods

2012-10-09 Thread Stuart Sierra
clojure.test is weird (my fault) but I don't think it's that weird. Your 'defmethod' is correct, but it shouldn't need the 'binding' around it. This works for me: user= (require '[clojure.test :as t]) user= (defmethod t/assert-expr 'fail [msg form] `(t/do-report {:type :fail :expected

Re: File endings proposal for easier cross-compiling

2012-10-08 Thread Stuart Sierra
Feature Expressions provide an escape from file extensions. http://dev.clojure.org/display/design/Feature+Expressions Everything could become a .clj file. Sources dedicated to different targets would live in different directories. -S -- You received this message because you are subscribed to

Re: Smarter code reloading with tools.namespace 0.2.0

2012-10-07 Thread Stuart Sierra
Hi Mika, Due to the current governing process of the Clojure contributor agreement, I cannot accept GitHub pull requests, only patches submitted via http://dev.clojure.org/jira My intent is for the functions in clojure.tools.namespace.repl to be a high-level API for direct invocation by

Re: cli latency

2012-10-07 Thread Stuart Sierra
JVM startup time has always been issue. Various tricks help: client mode, smaller heaps, tiered compilation (available in Java 7). Clojure adds another layer, which can be partially mitigated with AOT-compilation. But you'll never get the kind of instant command-line response that C can give

Re: Preferred business rules engines in or used by Clojure?

2012-10-07 Thread Stuart Sierra
Hi Grant, I am not aware of a rules engine written in Clojure, unless you are willing to consider a logic language like Datalog (Datomic) or Prolog (core.logic). Various rule-based systems exist for Java, but I would expect them to be very Java-centric. -S -- You received this message

Smarter code reloading with tools.namespace 0.2.0

2012-10-05 Thread Stuart Sierra
Announcing... tools.namespace 0.2.0. Just released, it will reach Maven Central in a few hours. Short summary: reload code in the REPL with greater accuracy and awareness of dependencies. Full documentation in the README: https://github.com/clojure/tools.namespace This is my latest attempt at

Re: Meaning of =

2012-10-05 Thread Stuart Sierra
On Wednesday, October 3, 2012 1:56:19 PM UTC-4, Warren Lynn wrote: Out of curiosity, if we want to check if two collections has the same structure/type and elements, namely if I want (my-equal [1 2 3 4 '(5)] [1 2 3 4 [5]]) = false (my-equal [1 2 3 4 [5]] [1 2 3 4 [5]]) = true Is there

Re: maplist for core?

2012-09-30 Thread Stuart Sierra
Never had a use for such a thing, myself, but it sounds like a reasonable candidate for https://github.com/clojure/core.incubator at least. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: google-closure-library 2029

2012-09-28 Thread Stuart Sierra
I made the G.Closure library artifacts and manually uploaded them to Maven Central. I haven't had time to do the latest G.Closure library release. Can somebody confirm that ClojureScript works 100% with the rev. 2029 release of the Closure Library? -S -- You received this message because you

Re: clojurescript: *ns*, all-ns, ns-map, ns-publics, ns-* ?

2012-09-26 Thread Stuart Sierra
Some of this information exists in the CLJS compiler, although it's not documented. For example, the cljs.analyzer namespace has *cljs-ns* and `namespaces`. You could examine these Vars at the Clojure (not ClojureScript) REPL. Vars and namespaces do not exist at all in compiled CLJS code, so

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Stuart Sierra
http://dev.clojure.org/display/community/Libraries is unorganized and out of date - volunteers welcome. James Reeves created http://www.clojure-toolbox.com/ -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: how do we go about promoting new clojure libraries?

2012-09-26 Thread Stuart Sierra
On Wednesday, September 26, 2012 3:05:08 PM UTC-4, Mayank Jain wrote: I am interested in keeping the clojure libraries up to date. Can you give me some ideas what are the tasks that needs to be done? So that I have some idea about it. 1. Send in a signed Clojure Contributor Agreement:

Re: JSON serialization with unknown types

2012-09-26 Thread Stuart Sierra
I'm working on a new version of data.json that supports conversions: https://github.com/clojure/data.json/tree/transform Feedback welcome on the API. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Request to create new contrib: data.dependency

2012-09-18 Thread Stuart Sierra
It's open source. You can do whatever you want, under the terms of the EPL. -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

Re: Request to create new contrib: data.dependency

2012-09-18 Thread Stuart Sierra
I didn't get approval to create data.dependency, so instead I've merged that work into tools.namespace, currently available as 0.2.0-SNAPSHOT. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Can't start Rhino repl for ClojureScript

2012-09-16 Thread Stuart Sierra
Leiningen works under Windows (as lein.bat). I'm not sure if it works under Cygwin. I've encountered problems in the past with Cygwin because the Java executable is the Windows version, using Windows path-separator characters, but scripts expect Unix-style path separators. Try downloading

Re: Why do Clojure collections have (seq) rather than supporting the ISeq interface directly?

2012-09-16 Thread Stuart Sierra
Mostly efficiency. A Seq generally gives you access to `first` and `rest` in constant time. Vectors, to take one example, cannot give you `rest` efficiently, but a Seq backed by the vector can. Clojure lists are implemented as singly-linked lists, which do have first/rest pointers, so they

Re: A Performance Comparison of SBCL Clojure

2012-09-07 Thread Stuart Sierra
Just wanted to say thanks for putting in all the work on the shootout programs, Andy. On Friday, September 7, 2012 1:12:44 AM UTC-7, Andy Fingerhut wrote: All Clojure programs within 4x the run time of the corresponding Java programs, averaging around 2.5x the run time of Java. That's pretty

Re: redefining multimethods at the repl

2012-09-05 Thread Stuart Sierra
This is what I started working on tools.namespace to solve. I came to the conclusion that it's impossible to make something that works in 100% of all cases, but I'm hoping to get to 90%. I added some notes to the wiki page too. -S -- You received this message because you are subscribed to the

Re: [emacs over ssh limitations]

2012-08-28 Thread Stuart Sierra
SSH in iTerm 2 from an OS X machine to a Linux server. $TERM is xterm-256color at both ends. We use this for pair-programming, so X and tramp are not helpful. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: A Performance Comparison of SBCL Clojure

2012-08-27 Thread Stuart Sierra
Maybe my impressions are out of date. Personally, I have neither the time nor the interest, but optimizers do your stuff! -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

Re: [emacs over ssh limitations]

2012-08-27 Thread Stuart Sierra
It's easy enough to test: fire up a small EC2 instance and use Emacs over an SSH+tmux session. You could also try using your own local Emacs that way by SSH'ing to localhost. In my experience, commands don't work in a terminal if they use modifier keys (Control, Meta, Shift) AND non-letter

Re: A Performance Comparison of SBCL Clojure

2012-08-25 Thread Stuart Sierra
The Alioth benchmarks are somewhat unfair to JVM languages because they include startup time for the JVM itself and often don't run enough iterations to engage the optimizer. -S On Sat, Aug 25, 2012 at 1:51 PM, Raymond de Lacaze del...@hotmail.comjavascript: wrote: Here’s a performance

Re: Performance of concatenating two vectors

2012-08-24 Thread Stuart Sierra
I haven't read the paper, but Clojure's PersistentVector doesn't really have a concatenate operation. The `concat` function creates a lazy sequence. The closest to vector concatenation is probably `into`, which is implemented in terms of `reduce`. -S -- You received this message because you

Re: [viewing clojure datastructures] Is there something better than clojure.inspector?

2012-08-23 Thread Stuart Sierra
Somewhat-related, I started working on a graphical pretty-printer library for ClojureScript: https://github.com/stuartsierra/cljs-formatter Here's a screenshot: https://github.com/stuartsierra/cljs-formatter/blob/master/screenshot-1.png -S -- You received this message because you are

Re: Central screwup

2012-08-16 Thread Stuart Sierra
Just want to make this is clear: no one on the Clojure mailing list (or IRC) has any direct control over the major public repositories. The Maven Central Repository (repo1.maven.org) is managed by the Apache Foundation with help from Sonatype, Inc. See

Re: Central screwup

2012-08-16 Thread Stuart Sierra
Thanks, Phil, -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: clojure.logic project.clj file

2012-08-16 Thread Stuart Sierra
On Wednesday, August 15, 2012 9:39:21 PM UTC-4, Chas Emerick wrote: I'd hope to see this change once the final missing pieces fall into place (in particular, automation of promotion of releases through Nexus' API corresponding to or surpassing what nexus-maven-plugin provides).

Re: basic question , clojure io

2012-08-09 Thread Stuart Sierra
No, there is no language-level distinction between pure functions and functions which perform side effects. In practice, it is a good idea to keep them separate. -S On Tuesday, August 7, 2012 9:37:31 AM UTC-4, centaurian_slug wrote: does clojure have a strict split between side-effects and

Re: How to add an URL into the classpath?

2012-07-29 Thread Stuart Sierra
You can't. The dynamic classloader is an internal implementation detail of Clojure; you can't rely on it being available anywhere. If you're interested in runtime control over the the Java classpath, look at https://github.com/cemerick/pomegranate -S On Sunday, July 29, 2012 2:05:00 PM

Re: How to add an URL into the classpath?

2012-07-27 Thread Stuart Sierra
Hello Yoshinori, In general, you cannot modify the JVM classpath at runtime. Clojure uses its own classloader to do dynamic code generation, but you cannot rely on being able to control the classloader which is running the whole JVM. -S -- You received this message because you are subscribed

Re: slurp on over slow HTTP crashes clojure?

2012-07-20 Thread Stuart Sierra
The 'slurp' function on a URL dispatches to java.net.HttpURLConnection, which is pretty primitive as HTTP clients go. If you need to handle slow sites or large responses, you'll probably be better off with a real HTTP client library. -S -- You received this message because you are subscribed

Re: Tagged literals: undefined tags blow up reader

2012-07-16 Thread Stuart Sierra
Hi Kovas, I considered the problem of what to do with undefined tags when I implemented this, but I didn't have a clear idea of what the result type should be, so I ignored it. I also didn't know what to do with the metadata. For example, on the JVM, you can't put metadata on Java types like

Re: Central screwup

2012-06-14 Thread Stuart Sierra
Is there anyone on the Clojure/core team with a contact among those who run Central who could get them to look into this? I'm on the Sonatype OSSRH mailing list: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide (mailing list addresses at the bottom)

Re: Problems resolving dependencies due to maven central repo fail

2012-06-13 Thread Stuart Sierra
Hi Craig, I can't reproduce the problem you're seeing. Right now, when I visit http://repo1.maven.org/maven2/org/clojure/clojure/maven-metadata.xml I get the the same list as Article A in your original post. Is it possible that the maven-metadata-central.xml file in your local Maven cache is

Re: clashing methods between 2 different protocols???

2012-06-13 Thread Stuart Sierra
I see you have found that you can override Object.toString in defrecord by including Object in your defrecord. However, Object is a special case, since every Java class extends Object. You *can* have two protocols with the same method name, but they must be in *different* namespaces. Every

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-09 Thread Stuart Sierra
On Fri, Jun 8, 2012 at 5:55 PM, OGINO Masanori masanori.og...@gmail.com wrote: There are many negative votes for the proposal and the main doubt is do you need to make them in closure.string? Hi Ogino, Please don't misinterpret my comments as saying you're wasting time. By all means, keep

Re: Is still idiomatic the ant simulation code?

2012-06-08 Thread Stuart Sierra
The ants demo is definitely dated. It's not terrible, but the code could use some polishing/simplifying using newer additions to the language. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-08 Thread Stuart Sierra
Seems like a fairly specialized function. No harm in including it where it's needed, but does it need to go in clojure.string? -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: Deserialization of a Record

2012-06-08 Thread Stuart Sierra
Can you post a standalone example that doesn't require seesaw? Otherwise it's hard to reproduce the problem. If the problem is class visibility on the EDT, there are a couple of possiblities: 1. Bind *use-context-classloader* to false in your event handler. This might work. 2. Have the event

Re: Why does (send a f) hang in this code, if f returns an agent?

2012-06-08 Thread Stuart Sierra
I'm not sure why it hangs, but my guess is that your actions are throwing exceptions, breaking the loop and preventing the SynchronousQueue from ever being filled. By the way, the `time` you're measuring will dominated by `pprint`, not your actual test. -S -- You received this message

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-08 Thread Stuart Sierra
Stuart Halloway wrote: Whatever we do let's make sure we think about how to make it available in all Clojure dialects. Yes. When it comes to adding stuff to clojure.string, I'd like to focus less on adding single-purpose functions like dasherize and more on making sure that it's possible to

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-08 Thread Stuart Sierra
On Fri, Jun 8, 2012 at 2:13 PM, Andy Fingerhut andy.finger...@gmail.com wrote: Are you concerned that there are differences in regex implementations between host platforms? Slightly. Or are you hoping that someone develops a portable-between-Clojure-hosts regex implementation and adds that

Re: Avoid duplicate computation in commute?

2012-05-17 Thread Stuart Sierra
I think the point with `commute` is to allow for more concurrency at the expense of more computation. If you want assurance that your function is only called once, you can use `alter`. Keep in mind that *any* code in a Ref transaction has the potential to be called more than once if there's a

Re: Assuring avalaibility of ring web apps

2012-05-17 Thread Stuart Sierra
This is probably outside the scope of what Lein and Clojure do, but it's a well-studied problem for JVM apps. AWS itself has a variety of solutions, such as Elastic Beanstalk and Cloud Formation. At the OS-level, there's monit and its kin. -S -- You received this message because you are

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Stuart Sierra
Yes, Clojure has a runtime which is initialized the first time you call any Clojure code. The initialization never happens more than once. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: docstrings of if-let and when-let incorrect

2012-05-16 Thread Stuart Sierra
How would multiple bindings for if-let or when-let work? Should every binding be testedd? Should they be and-ed together? Should it short-circuit if the first is false? I don't think there are obvious answers to those questions. -S -- You received this message because you are subscribed to

[ANN] ClojureScript release 0.0-1236

2012-05-16 Thread Stuart Sierra
http://build.clojure.org/job/clojurescript-release/12/ Highlights: - Reducers - Dependencies on latest Google Closure Compiler and Library - Partial support for of data reader functions (tagged literals) -- You received this message because you are subscribed to the Google Groups Clojure

[ANN] New Google Closure Library JARs (incl third-party)

2012-05-16 Thread Stuart Sierra
http://search.maven.org/#search%7Cga%7C1%7Cgoogle%20closure I have pushed out new releases of the Google Closure Library JARs. You can now get these dependencies directly from Maven Central: [org.clojure/google-closure-library 0.0-1376] [org.clojure/google-closure-library-third-party 0.0-1376]

Re: Idiomatic usage of partial

2012-05-16 Thread Stuart Sierra
Every literal instance of `fn` or `#()` compiles to a new class definition. This is only at compile time: once the code is running, each execution of the `fn` expression merely creates an instance of that class. partial is implemented in terms of `fn`, so every usage of `partial` merely

Request to create new contrib: data.dependency

2012-05-16 Thread Stuart Sierra
As part of my long-delayed effort to get namespace dependency parsing into Contrib, I offer the clojure.data.dependency library: https://github.com/stuartsierra/data.dependency This is wholly my own work. I give permission to release it under the Clojure Contributor Agreement. -S -- You

Re: defrecord serialization and *data-readers*

2012-05-15 Thread Stuart Sierra
Data reader literals are not intended to replace record serialization. If you want the flexibility to change your record types, I think you need to use data reader literals from the beginning, and have them deserialize as the appropriate record type. -S -- You received this message because

Re: docstrings of if-let and when-let incorrect

2012-05-15 Thread Stuart Sierra
Reasonable enough. Patch welcome. -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

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