Re: [ANN] analyze 0.1

2012-01-03 Thread Ambrose Bonnaire-Sergeant
Yes, that will fix it, but I'm not sure of the implications or why exactly it's necessary. I'll push it to master. Thanks, Ambrose On Tue, Jan 3, 2012 at 3:55 PM, Jonas jonas.enl...@gmail.com wrote: On Tuesday, January 3, 2012 9:45:04 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: It seems

Late provide error in compiling clojurescript files

2012-01-03 Thread Praki
Hi, I have a silly problem compiling my cljs files. I have to run the cljsc command twice in succession to generate javascript source. The first compilation results in: ERROR: JSC_LATE_PROVIDE_ERROR. required foo.bar namespace not provided yet at /home/.../src/../target/classes/public/js/core.js

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Tassilo Horn
Baishampayan Ghose b.gh...@gmail.com writes: Hi Baishampayan, ,[ C-h f ansi-color-for-comint-mode-on RET ] | ansi-color-for-comint-mode-on is an interactive compiled Lisp function in | `ansi-color.el'. | | (ansi-color-for-comint-mode-on) | | Set `ansi-color-for-comint-mode' to t.

Re: [ClojureScript] Wrapping all def into a load event handler

2012-01-03 Thread Takahiro
Hi, Putting javascript at the bottom of body is nice idea. Thanks. 2012/1/2 Stuart Sierra the.stuart.sie...@gmail.com: Hi Takahiro, This will work. It's not 100% idiomatic Clojure, but it's an acceptable workaround to the DOM loading issue. If ClojureScript had `alter-var-root`, which it

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Baishampayan Ghose
Tassilo, Not that I know of.  But you could try to run the ansi translation in sldb-mode-hook. --8---cut here---start-8--- (defun th-ansi-colorize-buffer ()  (ansi-color-apply-on-region (point-min) (point-max))) (add-hook 'sldb-mode-hook

Do you use Monads in your real clojure applications

2012-01-03 Thread googlegroups
Dragan R writes: On the net I read that Impure functional programming doesn't really need monads. and It appears that in the presence of mutable state, a lot of the advantages of monads become moot. Monads are an abstraction mechanism, so you never need them. You can always use the

Re: Do you use Monads in your real clojure applications

2012-01-03 Thread Meikel Brandmeyer
Hi, I used monads in two projects. * The last rewrite of ClojureQL before v1.0 used a state monad to keep track of various things during query creation. * ClojureCheck also uses a monad approach to create and combine generators for test data. * Dave Ray and I tried a monad style in the async

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Tassilo Horn
Baishampayan Ghose b.gh...@gmail.com writes: Hi again, The second option gives an error the moment the sldb buffer comes up. It says - error in process filter: insert: Wrong number of arguments: (lambda nil (ansi-color-apply-on-region (point-min) (point-max))), 3 Ah, yes. Now I've

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Baishampayan Ghose
Getting colors outside M-x clojure-jack-in requires a couple extra steps I forgot to document, I just added it here: https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74 Just curious, you mention loading the file `slime-compile-presave`, but I wonder what it has got to do

core.match or patterns

2012-01-03 Thread JuanManuel Gimeno Illa
I'm trying to use :or patterns with records but I'm getting an error and I'm not sure if I have found a bug (or a not-implemented-yet) or if its the intended behavior (and there are good reasons for it). Without :or patterns I can do: (let [x {:a 1 :b 2}] (clojure.core.match/match [x]

Where is ltrim?

2012-01-03 Thread Cedric Greevey
The clojure.string namespace has replaced clojure.contrib.str-utils and clojure.contrib.str-utils2. There's a problem, though: the str-utils2/ltrim function seems to be missing. This is a breaking change for some code I'm porting from 1.2 to 1.3. Where is that function now? -- You received this

Re: Where is ltrim?

2012-01-03 Thread James Reeves
On 3 January 2012 11:06, Cedric Greevey cgree...@gmail.com wrote: There's a problem, though: the str-utils2/ltrim function seems to be missing. This is a breaking change for some code I'm porting from 1.2 to 1.3. Where is that function now? clojure.string/triml I believe. - James -- You

Re: Where is ltrim?

2012-01-03 Thread Cedric Greevey
On Tue, Jan 3, 2012 at 6:11 AM, James Reeves jree...@weavejester.com wrote: On 3 January 2012 11:06, Cedric Greevey cgree...@gmail.com wrote: There's a problem, though: the str-utils2/ltrim function seems to be missing. This is a breaking change for some code I'm porting from 1.2 to 1.3. Where

Re: core.match or patterns

2012-01-03 Thread David Nolen
On Tue, Jan 3, 2012 at 4:16 AM, JuanManuel Gimeno Illa jmgim...@gmail.comwrote: I'm trying to use :or patterns with records but I'm getting an error and I'm not sure if I have found a bug (or a not-implemented-yet) or if its the intended behavior (and there are good reasons for it). Without

Re: core.match or patterns

2012-01-03 Thread JuanManuel Gimeno Illa
I'm using 0.2.0-alpha8 Juan Manuel -- 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: Do you use Monads in your real clojure applications

2012-01-03 Thread Philip Potter
On 3 January 2012 08:46, googlegro...@khinsen.fastmail.net wrote: Dragan R writes:   On the net I read that Impure functional programming doesn't really   need monads.   and It appears that in the presence of mutable state, a lot of the   advantages of monads become moot. Monads are an

Re: core.match or patterns

2012-01-03 Thread David Nolen
Please try using master. If that works for you, I can cut another alpha release. David On Tue, Jan 3, 2012 at 9:11 AM, JuanManuel Gimeno Illa jmgim...@gmail.comwrote: I'm using 0.2.0-alpha8 Juan Manuel -- You received this message because you are subscribed to the Google Groups Clojure

Re: Where is ltrim?

2012-01-03 Thread Meikel Brandmeyer
Hi, Am 03.01.2012 um 12:16 schrieb Cedric Greevey: Breaking changes are bad enough without making some of them gratuitous. They could have just renamed the namespace without also renaming some of the individual functions. :) One could also argue the other way around: When we break things

Re: core.match or patterns

2012-01-03 Thread JuanManuel Gimeno Illa
El martes 3 de enero de 2012 15:30:24 UTC+1, David Nolen escribió: Please try using master. If that works for you, I can cut another alpha release. Now the example works and I've found no problems using it with my code. Thanks, Juan Manuel -- You received this message because you are

Re: Where is ltrim?

2012-01-03 Thread Ben Smith-Mannschott
On Tue, Jan 3, 2012 at 16:09, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 03.01.2012 um 12:16 schrieb Cedric Greevey: Breaking changes are bad enough without making some of them gratuitous. They could have just renamed the namespace without also renaming some of the individual functions.

Re: Do you use Monads in your real clojure applications

2012-01-03 Thread Lee Hinman
We use monads within one of our work project, but not to any large amount. It mostly boils down to using the Maybe monad to avoid giant nested if- lets. - Lee Hinman -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Do you use Monads in your real clojure applications

2012-01-03 Thread jim
On Jan 3, 2:46 am, googlegro...@khinsen.fastmail.net wrote: I probably use monad more than the average programme in my own code, but that's also because I happen to be familiar with them. I could very well live with fewer monads in my code. But once you know monads, they appear magically

Sonian is looking for Clojure Developers

2012-01-03 Thread Paul Stadig
For the HR version you can visit this link: http://www.sonian.com/about/careers/principal-software-engineer-cloud/ Here's the IMO version: At Sonian, we have a great team working on interesting problems. Our backend is written in Clojure and runs 100% on the cloud. We distribute work across a

Extending core.match to custom types

2012-01-03 Thread Tassilo Horn
Hi all, I'm playing around with core.match and trying to extend it to some custom types in terms of extending the IMatchLookup protocol on those. But that's not quite what I need. IMatchLookup only specifies how to access some value out of my custom types, and in the `match' clauses those values

Use You a Spaced Repetition System for Great Good!

2012-01-03 Thread Joshua
Anybody else using a spaced repetition system (SRS) for Clojure learning? What about just general programming? How did it work out for you? I've just started using Anki and I uploaded a Clojure Sequence API shared deck. I'm hoping others might be interested in adding other Clojure related

Re: Extending core.match to custom types

2012-01-03 Thread David Nolen
On Tue, Jan 3, 2012 at 11:13 AM, Tassilo Horn tass...@member.fsf.orgwrote: Hi all, I'm playing around with core.match and trying to extend it to some custom types in terms of extending the IMatchLookup protocol on those. But that's not quite what I need. IMatchLookup only specifies how to

How can I make this kind of error message more useful?

2012-01-03 Thread Larry Travis
I have been solving Clojure problems now for many months and can no longer exactly be considered a Clojure NOOB, but I still have an awful lot to learn about Clojure. One thing that has caused difficulties from the beginning is that I don't know Java and don't know how to exploit the Java

Re: accessing multiple return values

2012-01-03 Thread nchurch
This is a really neat macro, but would people want to rewrite their programs in continuation-passing style just to be able to return multiple values sometimes? (And a macro is not a first-class entity.) Of course, much of the time, the easiest thing to do \is to return a vector or some other

Re: Use You a Spaced Repetition System for Great Good!

2012-01-03 Thread Linus Ericsson
Hi Joshua! I've been using Anki for repeating unsorted Clojure-stuff in about a year. It's good for knowing all the instructions and source code, but the key to success is always to solve more or less complicated problems (4clojure.orgetc). On the practical side I have a lot left to learn, also

Re: How can I make this kind of error message more useful?

2012-01-03 Thread David Nolen
On Tue, Jan 3, 2012 at 12:09 PM, Larry Travis tra...@cs.wisc.edu wrote: I have been solving Clojure problems now for many months and can no longer exactly be considered a Clojure NOOB, but I still have an awful lot to learn about Clojure. One thing that has caused difficulties from the

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Phil Hagelberg
Baishampayan Ghose b.gh...@gmail.com writes: Getting colors outside M-x clojure-jack-in requires a couple extra steps I forgot to document, I just added it here: https://github.com/technomancy/swank-clojure/commit/94fa71f90e52c55d74 Just curious, you mention loading the file

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Phil Hagelberg
Cedric Greevey cgree...@gmail.com writes: Seriously, though. Terminals? Escape codes? Impedance mismatches involving term types and escape codes? What is this, the Dark Ages? Those kinds of problems simply should not trouble us in the 21st century. Plonk. -- You received this message

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Cedric Greevey
On Tue, Jan 3, 2012 at 12:32 PM, Phil Hagelberg p...@hagelb.org wrote: Cedric Greevey cgree...@gmail.com writes: Seriously, though. Terminals? Escape codes? Impedance mismatches involving term types and escape codes? What is this, the Dark Ages? Those kinds of problems simply should not

Re: How can I make this kind of error message more useful?

2012-01-03 Thread Meikel Brandmeyer
Hi, Am 03.01.2012 um 18:24 schrieb David Nolen: On Tue, Jan 3, 2012 at 12:09 PM, Larry Travis tra...@cs.wisc.edu wrote: But my error messages are more likely to look like this: java.lang.Exception: Unsupported binding form: (quote symb) (NO_SOURCE_FILE:5045) Where does the 5045

Re: accessing multiple return values

2012-01-03 Thread Tassilo Horn
nchurch nchubr...@gmail.com writes: Replying to Tassilo: I'm not quite sure I understand this problem: then changing its name requires changing all places where clojure.core.quotient/remainder is used surely the call to Values takes place inside the function definition, which happens

Re: Use You a Spaced Repetition System for Great Good!

2012-01-03 Thread daly
I have built several Anki SRS decks for learning. I am building one now on American Sign Language. A Clojure deck would be a good idea. We could put a simple deck on github and make it so others could contribute. What should it cover? Only language syntax? Idiomatic forms (like lazy sequences)?

Re: Do you use Monads in your real clojure applications

2012-01-03 Thread Mark Engelberg
Some of the most common uses for monads have pre-existing mechanisms with Clojure to handle them, e.g.: sequence monad (for) state monad (Clojure has many stateful mechansisms) maybe monad (Clojure programmers usually just return nil for failure, and use something like when-let to process it) In

Re: accessing multiple return values

2012-01-03 Thread nchurch
You're quite correct that the namespace \mechanism as it stands would not work for thisgood point. I guess I am just suggesting using the \syntax to do something let-like. Perhaps it would be better to make up a completely different syntax. As for your example, I'm still not sure we

Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
Hi All, So, I've been doing some experimentation in order to better understand the reader, and I can't figure out why I get the following results for these four calls: = ('foo); ((quote foo)) java.lang.IllegalArgumentException: Wrong number of args (0) passed to: Symbol

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread nchurch
If I could hazard a guess, it has to do with symbol lookup in maps. Try the following: ('foo {'foo 1}) ('foo {'bloo 1} 4) when you do ('foo 1), it can't find foo in 1 (because it isn't there, and 1 isn't even a map), so it returns nil. If you do ('foo 1 2), you've just provided a default

Re: Extending core.match to custom types

2012-01-03 Thread Tassilo Horn
David Nolen dnolen.li...@gmail.com writes: Hi David, In my patterns, I want to have a :+type key with a value that's basically an interface name given as a symbol. The pattern should match, if the class of the object implements that interface (or an extended interface thereof) directly or

Re: accessing multiple return values

2012-01-03 Thread Tassilo Horn
nchurch nchubr...@gmail.com writes: You're quite correct that the namespace \mechanism as it stands would not work for thisgood point. I guess I am just suggesting using the \syntax to do something let-like. Perhaps it would be better to make up a completely different syntax. As for

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread JuanManuel Gimeno Illa
I'm not 100% sure but this is a side effect of the property that symbols can be used as functions that find themselves on maps. For instance: (def m {'a 1 'b 2 'c 3}) ('a m) ;= 1 ('b m) ;= 2 and, when the symbols is not found, we have: ('d m) ;= nilurn ('d m :nono) ;= :nono So a symbol is a

Re: accessing multiple return values

2012-01-03 Thread nchurch
I think, I'll stop here.  You won't convince me that this approach is practicable anytime soon. ;-) I certainly won't try too hard either. I'm not questioning here whether it is immediately practicable to implement (maybe not, and in case a very long discussion) but is it potentially useful?

Re: Extending core.match to custom types

2012-01-03 Thread David Nolen
Putting that kind of logic in IMatchLookup doesn't make much sense to me: I'm not sure about the following syntax, but something like this could be done w/o interfering with IMatchLookup. (match [obj] [({:mice 4} :type cat)] ... [({:cats 4} :type dog)] ... [({:cats 4} :type :not [cat dog]]

Re: How can I make this kind of error message more useful?

2012-01-03 Thread Larry Travis
David and Meikel: Thanks for your responses, but it appears to me that what you say applies only to error messages referring to evaluation of defn expressions. Constructing my function definitions in a file separate from the REPL and then recompiling the entire file with a load-file whenever

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
On Tue, Jan 3, 2012 at 2:11 PM, JuanManuel Gimeno Illa jmgim...@gmail.com wrote: I'm not 100% sure but this is a side effect of the property that symbols can be used as functions that find themselves on maps. Thanks Juan Manuel - that's the thing I was missing (and thanks for the source link).

Re: Use You a Spaced Repetition System for Great Good!

2012-01-03 Thread Joshua
Hi Tim, Great idea re: GitHub! I'm guessing the Clojure decks could cover, multiple things if tagged appropriately and could be studied in various section. Or there could be multiple decks dealing with differing material. I'm not very familiar with github, but it is high time I really check it

Re: accessing multiple return values

2012-01-03 Thread meb
I see two fairly straightforward paths to simulating multiple returns without breaking existing callers. Both take advantage of thread-local state and establish one convention for the caller: before calling the function again, every caller interested the extra return values must ask for these

Re: accessing multiple return values

2012-01-03 Thread Gary Trakhman
It seems like we're talking about conflation of language implementation details to simulate a hash-map. Why not just use a hash-map for named values? Or a lazy sequence? A function returns a 'value', which can be a single thing, a collection of things, or even an arbitrary graph of things. If

Re: accessing multiple return values

2012-01-03 Thread Cedric Greevey
On Tue, Jan 3, 2012 at 6:05 PM, meb meba...@gmail.com wrote: I see two fairly straightforward paths to simulating multiple returns without breaking existing callers. Both take advantage of thread-local state and establish one convention for the caller ... Both of them have reentrancy problems

Re: Do you use Monads in your real clojure applications

2012-01-03 Thread Takahiro Hozumi
In MVC pattern, Model should take responsibility for business logic. Therefore I write validate function for creating in the model. If creating a instance of the model should be safe, I must validate a parameter in the create function. My problem is that a controller have to validate a parameter

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Takahiro
Phil There are lots of problems with version ranges, but this would be a bad idea for Ring specifically because it would allow backwards-incompatible versions to be pulled in when a new breaking clj-stacktrace version is released. Thank you for sharing your thoughts. 2012/1/2 Phil Hagelberg

macro question

2012-01-03 Thread Trevor
hmmm macro question: ; here's a macro that assembles many puts. It serves no purpose to me (and doesn't even make sense in its current form). It's just something I hit playing around and learning macros. (defmacro doto-putter [x y xs] `(doto (java.util.HashMap.) (.put ~x ~y)

Re: macro question

2012-01-03 Thread Alan Malloy
On Jan 3, 7:22 pm, Trevor tcr1...@gmail.com wrote: hmmm macro question: ; here's a macro that assembles many puts. It serves no purpose to me (and doesn't even make sense in its current form). It's just something I hit playing around and learning macros. (defmacro doto-putter [x y xs]  

Storing clojure lists and maps in Redis

2012-01-03 Thread Shoeb Bhinderwala
I am trying to use Redis as a data structure cache for my clojure application. Does anybody have experience/code/ideas that can write/ read a clojure complex data structure to the Redis cache. For example I have a list of maps as shown below: (def m1 [{ total {:end_mv_base 721470021.02M,

Re: Storing clojure lists and maps in Redis

2012-01-03 Thread Daniel Pittman
On Tue, Jan 3, 2012 at 22:30, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com wrote: I am trying to use Redis as a data structure cache for my clojure application. Does anybody have experience/code/ideas that can write/ read a clojure complex data structure to the Redis cache. […] How can I

Re: Storing clojure lists and maps in Redis

2012-01-03 Thread Baishampayan Ghose
Shoeb, What about storing it as a string? You can either use pr-str or data.json/generate-string. You can then read it back using read-string or the equivalent json fn. Regards, BG On Wed, Jan 4, 2012 at 12:00 PM, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com wrote: I am trying to use Redis

Re: Storing clojure lists and maps in Redis

2012-01-03 Thread Softaddicts
We use Clojure's reader representation to serialize data structures as strings here and we still have some Java and JRuby code around. Previously we were using YAML (json was in it's infancy when we opted for YAML). A real pain in the ass... Now we use a couple of protocols callable from every

Re: Storing clojure lists and maps in Redis

2012-01-03 Thread Shoeb Bhinderwala
Daniel, Baishampayan - Thanks for the suggestion. I was able to do this extremely easily using the JSON library. I used the json-str and read-json functions. Shoeb On Jan 4, 1:38 am, Baishampayan Ghose b.gh...@gmail.com wrote: Shoeb, What about storing it as a string? You can either use

Re: [ANN] swank-clojure 1.3.4 released

2012-01-03 Thread Jack Moffitt
The main feature in this release is Derek Mansen's work integrating clj-stacktrace into the debugger frames, so now you can get stack traces with alignment and colorization. I'm very excited about this release since it's a significant usability improvement: http://imgur.com/fD3rA I get the