print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
* (ns com.samedhi.app.test.behavior-test (:require [clojure.test.generative :as generative]) (:use [com.samedhi.quizry.app.test.defspec :only [defspec]] )) * *... ommited content ...* * * *(def ^:dynamic *view* nil)* * * *(binding [*view* (atom

Re: two pass compilation, intern and def

2013-09-20 Thread Meikel Brandmeyer
Not that I am aware of. do is special to allow macros expanding into several defs where the later depend on the former. (defmacro foo [a b] `(do (def ~a 5) (def ~b ~a))) This is necessary, because a macro can only return one form. And the name resolution for ns is special-cased,

Re: two pass compilation, intern and def

2013-09-20 Thread Phillip Lord
Gary Verhaegen gary.verhae...@gmail.com writes: As Meikel said in his previous mail, 'do' at the top-level is treated specially: each form is treated as a separate top-level form. This is, for example, useful for defining a macro that defines multiple functions. I'd be interested to see an

Re: two pass compilation, intern and def

2013-09-20 Thread Meikel Brandmeyer
Hi, 2013/9/20 Phillip Lord phillip.l...@newcastle.ac.uk (def bob3 3) introduces a new symbol, I am struggling to see why (intern 'user 'bob3 3) cannot be recognised similarly. Because intern happens at runtime. It's a normal function. The above intern call is easily translated to the

Re: Safely flush old value out of an atom

2013-09-20 Thread Meikel Brandmeyer (kotarak)
Hi, don't bother. That's perfectly ok, and no, there is no library function for that. I know quite a number of developers having implemented exactly this function (myself included). Kind regards Meikel -- -- You received this message because you are subscribed to the Google Groups Clojure

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Jim
On 20/09/13 08:01, Stephen Cagle wrote: * * *(generative/defspec* * check-on-quiz-view* * b/quiz-view* * [^{:tag `random-loc} loc* * ^{:tag (clojure.core/constantly :ignored)} key* * ^{:tag `view} value]))* It seems to me the problem is the above snippet...why

Re: two pass compilation, intern and def

2013-09-20 Thread Phillip Lord
Meikel Brandmeyer brandmeyer.mei...@gmail.com writes: 2013/9/20 Phillip Lord phillip.l...@newcastle.ac.uk (def bob3 3) introduces a new symbol, I am struggling to see why (intern 'user 'bob3 3) cannot be recognised similarly. Because intern happens at runtime. It's a normal function.

ANN: Proof-of-concept structure editor for Clojure

2013-09-20 Thread Simon Brooke
I'd like to announce fedit, a structure editor for Clojure, is now available on GitHub: https://github.com/simon-brooke/fedit It is experimental, proof of concept code, and has bugs and infelicities. It emulates the Portable Standard Lisp/Cambridge Lisp fedit, a terminal oriented structure

Re: [ANN] Cognitect

2013-09-20 Thread François De Serres
Bonne chance Cognitect !!! Le lundi 16 septembre 2013 15:50:46 UTC+2, Rich Hickey a écrit : I just wanted to let everyone know that Metadata Partners (the company behind Datomic) and I have merged with Relevance, Inc., to form Cognitect, Inc. This merger is great for Clojure, adding

Efficiently typing an argument of implementation in deftype

2013-09-20 Thread Dmitry Groshev
In this mail I'm talking about Clojure 1.4, however, I believe that the issue persists in later versions, too. I have quite a lot of code of the following form: (defprotocol sum-proto (sum [x y])) (deftype Pair [^long a ^long b] sum-proto (sum [x y] (let [^Pair y y

[ANN] A pre-release of the Scribble syntax in Clojure

2013-09-20 Thread Bogdan Opanchuk
Hello all, There was a thread a while ago with me asking about the ways to modify the S-expression syntax in Clojure as it's done in Scribblehttp://docs.racket-lang.org/scribble/reader.html. Long story short, I'm happy to announce a working (well, to my current knowledge) implementation: on

[GSoC] Some subtle details of type-hinted macro expansion in Clojure

2013-09-20 Thread Dmitry Groshev
I've summarized a couple of things that wasn't obvious to me when I started to work on core.matrix's macroses. Comments are appreciated: http://si14.livejournal.com/51576.html -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Reading single characters...?

2013-09-20 Thread Simon Brooke
I've discovered some interesting behaviour - not necessarily a bug, and (if it is a bug) not necessarily a bug in Clojure. Essentially, to emulate a 1970s user interface, I want to read single key strokes from the console. I've found two recipes online, both using the JLine java package:

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
ugh, I also see that for the last example, where I just removed the binding I said all 4 threads, I should have said all N threads. (There are 4 in my case, but that is just on my machine) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: [GSoC] Some subtle details of type-hinted macro expansion in Clojure

2013-09-20 Thread Maik Schünemann
great summary of your experience. I think others will find this helpful. I was also surprised at first that the metadata is added to the next form *read* if you use ^ reader macro. This explains the following behaviour: (meta ^:matrix 'x) ;= nil (meta ' ^:matrix x) ;= {:matrix true} in the first

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
(... don't you wish you could edit your post). And shoot, the last example should have been the following (I had forgot to remove the (constantly nil) parts: *(def ^:dynamic *view* (atom* * {:old-model [nil nil nil nil nil nil]* *:quiz [nil nil nil

Lifecycle Composition

2013-09-20 Thread Murtaza Husain
Hi, I am going through the blog of Stuart Sierra regarding lifecycle composition. http://stuartsierra.com/2013/09/15/lifecycle-composition In the end there is this para - This technique is a form of dependency injection through constructors. The choice of whether to make the individual

ANN EEP 1.0.0-alpha5 is released

2013-09-20 Thread Michael Klishin
EEP [1] is a Clojure stream processing library. 1.0.0-alpha5 is a development release that introduces a few minor API improvements and bug fixes. Release notes: http://blog.clojurewerkz.org/blog/2013/09/20/eep-1-dot-1-0-alpha5-is-released/ 1.

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Stephen Cagle
Good eye. To your second point, I accidentally copied those namespaces out when attempting to focus my report of this problem. * [com.samedhi.app.fixture :as f]* * [clojure.data.generators :as g]* So clojure.test.generative as generative and clojure.data.generators as g. To your last

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Jamie Brandon
JVM bytecode can't contain data-structures, only code. If you eval something or embed it in macro output the clojure compiler needs to be able to output code that reconstructs an equal object. There are some types that it can't do that for. user= (def x) #'user/x user= x #Unbound Unbound:

Re: Efficiently typing an argument of implementation in deftype

2013-09-20 Thread Ambrose Bonnaire-Sergeant
Just a thought, could implementing IKeywordInvoke and using keywords for field lookups speed up compilation? Thanks, Ambrose On Fri, Sep 20, 2013 at 10:01 PM, Dmitry Groshev lambdadmi...@gmail.comwrote: In this mail I'm talking about Clojure 1.4, however, I believe that the issue persists in

Re: [ANN] Sleight: whole program transformations

2013-09-20 Thread Patrick Logan
Expansion Passing Style is a similar mechanism described in http://citeseerx.ist.psu.edu/viewdoc/summary;jsessionid=B1F3B3E99DE8FD3BD5CA489868730967?doi=10.1.1.50.4332 A number of interesting (and easy to implement) examples are in the paper, including debugging tools. This is an easy way to

[ANN] avl.clj: sorted maps and sets with fast rank queries via nth

2013-09-20 Thread Michał Marczyk
Hi, I have just released avl.clj, a library implementing drop-in replacements for Clojure(Script)'s sorted maps and sets which additionally support the transients API and logarithmic time rank queries via clojure.core/nth: (require '[avl.clj :as avl]) (nth (apply avl/sorted-set (range

Re: [ANN] avl.clj: sorted maps and sets with fast rank queries via nth

2013-09-20 Thread Michał Marczyk
On 21 September 2013 02:42, Michał Marczyk michal.marc...@gmail.com wrote: [avl.clj 0.0.1] dependency groupIdavl.clj/groupId artifactIdavl.clj/artifactId version0.0.1/version /dependency Make that [avl.clj 0.0.2] and dependency

Re: Efficiently typing an argument of implementation in deftype

2013-09-20 Thread Jason Wolfe
FWIW I observed the same thing profiling 1.5.1 with Yourkit a couple months ago and tried adding caching to the Clojure compiler, but I wasn't able to get any speedup. It wasn't clear to me if I messed something up, or if the profiler was just lying about where the execution time was actually