Re: "including" Protocols in clojurescript

2012-01-19 Thread Dave Sann
Hi, Meikel, this is not the case. Since the file is available to the compiler - it can and generally does do the right thing. David, I think that I have managed to replicate my issue. It occurs in a specific case where the protocols are defined in a jar. j/protocols/fred.cljs - define fred

Re: clojurescript goog libs - dispose - and garbage collection

2012-01-19 Thread Dave Sann
Thanks for the pointers. Cedric's idea is interesting. I have to say, I don't the idea of disposables in general - its back to manual memory management. I suspect they came up, out of necessity, because of how IE (used to?) fail to garbage collect between DOM and JS. Cheers D -- You receive

Re: Multimethods performance in ClojureScript.

2012-01-19 Thread Takahiro Hozumi
Thank you for your response. The reasons why I didn't use protocols are following. 1. Currently ClojureScript doesn't have `extend`, which makes inheritance easy. http://david-mcneil.com/post/1475458103/implementation-inheritance-in-clojure 2. I think an entity which is created by deftype or defr

Re: "including" Protocols in clojurescript

2012-01-19 Thread Meikel Brandmeyer (kotarak)
Hi, I still think I'm on the right track with my suspicion when reading your description. Example (Clojure, since I don't know ClojureScript): (ns proto.col) (defprotocol Foo (foo [this that])) (ns proto.participant (:use proto.col)) (extend-protocol Foo MyType (foo [this that] ...))

Re: "including" Protocols in clojurescript

2012-01-19 Thread Meikel Brandmeyer (kotarak)
As an another remark: even if things are baked together into single file (or however cljs works), I would expect the compiler to remove the extend since you did not specify you need it. At least this would be my expectation from the descriptions of the advanced mode of the compiler. Sincerely M

Re: "including" Protocols in clojurescript

2012-01-19 Thread Dave Sann
I did think the same way as you - but it doesn't seem to be the case. I can think of plausible ways that the compiler might achieve this but I don't know for sure. Anyway, Even with advanced mode compilation it does appear work fine except in the case that I highlighted. I'll leave it to an ex

Problem with clojure.org?

2012-01-19 Thread Dave Sann
Hi, I use the clojure.org/cheatsheet...a lot.. lol a couple of weeks ago I notices that the site was very slow to load and that something like 80% of links on the page don't work. There is a missing css GET http://c1.wikicdn.com/s/gz/1v8qv98z-theme_common.css 404 (Not Found) And a number of

Re: Problem with clojure.org?

2012-01-19 Thread Dave Sann
using Chrome. 17.0.963.33 beta Firefox seems to work 9.0.1 -- 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 fir

Re: Best IDE

2012-01-19 Thread Dennis Haupt
i'm also using ldea 11 ultimate + the newest plugin, but i the only debugger i can use is the standard java debugger, so i can only debug if i go a few steps back until i am inside the clojure internal classes i don't see/can evaluate any native clojure stuff can you send me a screenshot so i can

Re: "including" Protocols in clojurescript

2012-01-19 Thread Meikel Brandmeyer (kotarak)
I don't think I understand your point. >From your description I take it, that the other.project.proto.correct-user does work for you while other.project.proto.user does not. If this interpretation of mine was correct: This is exactly what you would expect from JVM clojure. Why should it be diff

Re: lein-cljsbuild 0.0.1 released

2012-01-19 Thread Shantanu Kumar
On Jan 19, 12:55 pm, Dave Sann wrote: > If you are referring to (2), I agree. > > But marking the type of a file by either path or extension is not a hack, > in my opinion. (3) > I was suggesting that ideally this would be better. I meant it for #2. Thanks for clarifying the details. Shantanu

Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread Laurent PETIT
Hello, Happy new year to all of you ! I'm glad to inform you that Relevance ( http://thinkrelevance.com/ ) offered sponsorship for my work on Counterclockwise! I'm really glad and grateful to them, and I'd like to especially thank Muness ( @muness ) and Christopher Redinger ( @redinger ) for mak

Re: Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread Baishampayan Ghose
> I'm glad to inform you that Relevance ( http://thinkrelevance.com/ ) offered > sponsorship for my work on Counterclockwise! Congratulations Laurent! I wish you all the very best. Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- You received this message because you are subscribed t

Re: Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread David Nolen
Exciting news congrats! David On Thursday, January 19, 2012, Laurent PETIT wrote: > Hello, > > Happy new year to all of you ! > > I'm glad to inform you that Relevance ( http://thinkrelevance.com/ ) offered sponsorship for my work on Counterclockwise! > > I'm really glad and grateful to them, an

Re: Problem with clojure.org?

2012-01-19 Thread Tom Hickey
Hi Dave, Wikispaces made some internal changes that messed up the clojure.org layout. I made some temporary changes to work around one issue, but broke the cheatsheet. Wikispaces just got back to me that they have put some fixes in place so I'll be working on fixing this today. Cheers, Tom --

Re: Best IDE

2012-01-19 Thread Maris
Emacs + Paredit is probably the best IDE. Nothing improves productivity like paredit. On Jan 18, 9:31 pm, Jay Fields wrote: > I'm not running the community edition (and I'm not sure if you are > either). I've updated to the latest LaClojure (when I upgraded to > IntelliJ 11). I've evaluated expr

Re: Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread Ambrose Bonnaire-Sergeant
Congratulations Laurent, you deserve it! Ambrose On Thu, Jan 19, 2012 at 9:20 PM, Laurent PETIT wrote: > Hello, > > Happy new year to all of you ! > > I'm glad to inform you that Relevance ( http://thinkrelevance.com/ ) > offered sponsorship for my work on Counterclockwise! > > I'm really glad a

identical?

2012-01-19 Thread Nicolas Garcin
Hi, I have a simple question regarding identical?: I understand that keywords with the same name refer to the same object. So (identical? :ab :ab) returns true. Now, if I do the following thing: (identical? "ab" (str "a" "b")) I get false, because my 2 strings are not the same objects even if

Re: identical?

2012-01-19 Thread Meikel Brandmeyer (kotarak)
Hi, string literals are interned. Similar to keywords. user=> (identical? "ab" "ab") true user=> (identical? "ab" (str "a" "b")) false user=> (identical? "ab" (.intern (str "a" "b"))) true Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" g

Re: identical?

2012-01-19 Thread David Nolen
On Thu, Jan 19, 2012 at 10:19 AM, Nicolas Garcin < nicolas.etienne.gar...@gmail.com> wrote: > Hi, > > I have a simple question regarding identical?: > I understand that keywords with the same name refer to the same > object. So > > (identical? :ab :ab) > > returns true. > Now, if I do the followin

Re: Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread Shantanu Kumar
Happy to see this news! Congrat's! Shantanu On Jan 19, 6:20 pm, Laurent PETIT wrote: > Hello, > > Happy new year to all of you ! > > I'm glad to inform you that Relevance (http://thinkrelevance.com/) > offered sponsorship for my work on Counterclockwise! > > I'm really glad and grateful to them,

= in ClojureScript differs from Clojure API for arities other than 2

2012-01-19 Thread Gijs S.
Subject: = in ClojureScript differs from Clojure API for arities other than 2 Using ClojureScript f4c0de502c92ce710da923888d672f22213b902c (checked out on Thu Jan 19 2012) => (= 1) false ;; incorrect => (= 1 1) true => (= 1 1 2) true ;; incorrect => (= 1 1 1) true ;; correct, but by accident

Re: Problem with clojure.org?

2012-01-19 Thread Tom Hickey
This should be fixed now. Please let me know if you see any issues. Cheers, Tom -- 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 p

Re: Best IDE

2012-01-19 Thread David Brunell
How long did it take you to get comfortable with paredit? I keep getting frustrated and going back to manually matching parens. On Thu, Jan 19, 2012 at 9:37 AM, Maris wrote: > > Emacs + Paredit is probably the best IDE. > Nothing improves productivity like paredit. > > -- You received this me

Re: Best IDE

2012-01-19 Thread Lee Spector
On Jan 19, 2012, at 11:42 AM, David Brunell wrote: > How long did it take you to get comfortable with paredit? I keep getting > frustrated and going back to manually matching parens. FWIW I've tried many times over many years and I never lost the frustration; I prefer free editing but with go

Re: = in ClojureScript differs from Clojure API for arities other than 2

2012-01-19 Thread David Nolen
On Thu, Jan 19, 2012 at 11:18 AM, Gijs S. wrote: > Subject: = in ClojureScript differs from Clojure API for arities other > than 2 > > Using ClojureScript f4c0de502c92ce710da923888d672f22213b902c (checked > out on Thu Jan 19 2012) > => (= 1) > false ;; incorrect > > => (= 1 1) > true > > => (= 1

Re: Best IDE

2012-01-19 Thread Laurent PETIT
2012/1/19 Lee Spector > > On Jan 19, 2012, at 11:42 AM, David Brunell wrote: > > > How long did it take you to get comfortable with paredit? I keep > getting frustrated and going back to manually matching parens. > > FWIW I've tried many times over many years and I never lost the > frustration;

Re: Best IDE

2012-01-19 Thread Sean Corfield
On Thu, Jan 19, 2012 at 9:07 AM, Laurent PETIT wrote: > I've tried paredit in emacs, found it really cool, and ported it to > Counterclockwise. > I'm now totally sold to it, and I couldn't imagine a working session with > Counterclockwise's "Strict edition mode" (aka paredit for emacsers) turned >

Re: Could be my favourite improvement in 1.4

2012-01-19 Thread Jeremy Heiler
On Tue, Dec 20, 2011 at 2:05 AM, Alan Malloy wrote: > I agree, this horrifies me. It isn't even as simple as "letting them > be whitespace", because presumably you want (read-string "{a: b}") to > result in (hash-map 'a 'b), but (read-string "{a :b}") to result in > (hash-map 'a :b). So you can't

how to get font-lock to work in swank repl buffer

2012-01-19 Thread Ben Smith-Mannschott
I'm trying to get syntax highlighting (font-lock) to work in the repl buffer provided by slime as described here: https://github.com/technomancy/swank-clojure (add-hook 'slime-repl-mode-hook (defun clojure-mode-slime-font-lock () (let (font-lock-mode) (clojure-m

Re: Problem with clojure.org?

2012-01-19 Thread Dave Sann
Looks fixed. good stuff Thanks Tom D -- 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 unsubsc

Re: Breaking news - Counterclockwise sponsored by Relevance !

2012-01-19 Thread Daniel Jomphe
Congrats Laurent, and thanks Relevance! -- 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 unsubscr

Re: how to get font-lock to work in swank repl buffer

2012-01-19 Thread Max Penet
Hello, This should do it: (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup) On Jan 19, 10:52 pm, Ben Smith-Mannschott wrote: > I'm trying to get syntax highlighting (font-lock) to work in the > repl buffer provided by slime as described > here:https://github.com/technomancy/swank-

Re: how to get font-lock to work in swank repl buffer

2012-01-19 Thread Max Penet
Well it *should*, now that I think of it, I am not using clojure-jack- in so it might be different. On Jan 20, 12:08 am, Max Penet wrote: > Hello, > > This should do it: > > (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup) > > On Jan 19, 10:52 pm, Ben Smith-Mannschott > wrote: > >

Re: how to get font-lock to work in swank repl buffer

2012-01-19 Thread Jack Moffitt
The instructions in the git repo don't work for me either, but > M-x clojure-mode-font-lock-setup > M-x font-lock-mode (turning it off) > M-x font-lock-mode (turning it back on) does. The suggested (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup) does not work either. You can autom

Re: "including" Protocols in clojurescript

2012-01-19 Thread Dave Sann
To clarify, I hope: in: protocols.fred.cljs ... ; define protocol Fred (defprotocol Fred (fred [this] "fred")) In: dom.protocols.fred.cljs ; extend Fred to js/Node In: main.cljs ... (:require [protocols.fred :as f]) ; non specific version ... (f/fred a-dom-node) Now - Case 1: put all this

Re: "including" Protocols in clojurescript

2012-01-19 Thread Meikel Brandmeyer
Thank your for patience with me. :) Now it's clearer. Case 2 and 3 is what I would expect from Clojure and Case 3 is the correct way to solve that problem. Case 1 is surprising (at least for me) and I would consider it “just lucky” as you put it. Adding the explicit require will always work and

Re: Best IDE

2012-01-19 Thread Mark Nutter
On Thu, Jan 19, 2012 at 11:42 AM, David Brunell wrote: > How long did it take you to get comfortable with paredit? I keep getting > frustrated and going back to manually matching parens. I had the same experience for a while, but then I realized I just had to remember 3 things: To enclose an ex

Re: Best IDE

2012-01-19 Thread Lee Spector
On Jan 19, 2012, at 8:26 PM, Mark Nutter wrote: > On Thu, Jan 19, 2012 at 11:42 AM, David Brunell wrote: >> How long did it take you to get comfortable with paredit? I keep getting >> frustrated and going back to manually matching parens. > > I had the same experience for a while, but then I r

Re: Best IDE

2012-01-19 Thread Alan Malloy
On Jan 19, 5:26 pm, Mark Nutter wrote: > If you put the cursor on the opening paren and then hit C-k, it cuts > out exactly that sexp (and its contents) but no more, keeping the > parens perfectly balanced. You want C-M-k, not C-k. C-k is a little more aggressive, since it always kills at least t

clojure-clr loadpath points to D: harddrive

2012-01-19 Thread jayvandal
Why does the clr point to d: work? user=> (use :reload 'ui) FileNotFoundException Could not locate db.mysql.clj.dll or db/ mysql.clj on load path. clojure.lang.RT.load (d:\work\clojure-clr\Clojure\Clojure\Lib \RT.cs:3065) user=> -- You received this message because you are subscribed to the Goog

Local memoization without letrec?

2012-01-19 Thread Mark Engelberg
The recipe for memoizing a recursive function is: (defn fib [x] ...) (def fib (memoize fib)) I want to do something like this for local functions, because I want to make a function that *produces* memoized functions (that way I can have a bunch of similar functions with their own memoized cache).

Re: Local memoization without letrec?

2012-01-19 Thread Cedric Greevey
Something like (defn make-memoized [some-param] (let [cache (atom {})] (fn [& args] (when-not (contains? cache args) (swap! cache assoc args (expensive-computation some-param args))) (cache args ? -- You received this message because you are subscribed to the Googl

Re: Local memoization without letrec?

2012-01-19 Thread Mark Engelberg
On Thu, Jan 19, 2012 at 9:46 PM, Cedric Greevey wrote: > Something like > > (defn make-memoized [some-param] >  (let [cache (atom {})] >    (fn [& args] >      (when-not (contains? cache args) >        (swap! cache assoc args (expensive-computation some-param args))) >      (cache args > Two

Re: Local memoization without letrec?

2012-01-19 Thread Mark Engelberg
I think this works: (defmacro memofn [name args body] `(let [cache# (atom {})] (fn ~name ~args (if-let [e# (find @cache# ~args)] (val e#) (let [ret# ~body] (swap! cache# assoc ~args ret#) ret#) If you spot any problems with this that I'm m

Re: Local memoization without letrec?

2012-01-19 Thread Cedric Greevey
On Fri, Jan 20, 2012 at 1:34 AM, Mark Engelberg wrote: > I think this works: > > (defmacro memofn [name args body] >  `(let [cache# (atom {})] >     (fn ~name ~args >       (if-let [e# (find @cache# ~args)] >         (val e#) >         (let [ret# ~body] >           (swap! cache# assoc ~args ret#)

Re: Local memoization without letrec?

2012-01-19 Thread Mark Engelberg
Fixed: (defmacro memofn [name args & body] `(let [cache# (atom {})] (fn ~name ~args (if-let [e# (find @cache# ~args)] (val e#) (let [ret# (do ~@body)] (swap! cache# assoc ~args ret#) ret#) -- You received this message because you are subsc

Re: Local memoization without letrec?

2012-01-19 Thread Meikel Brandmeyer (kotarak)
Hi, just in case you want a thread-safe, optimal version based on the classic memoize discussion[1]. (defmacro memofn [name args & body] `(let [cache# (atom {})] (fn ~name [& args#] (let [update-cache!# (fn update-cache!# [state# args#] (if-not (cont