Re: tools.trace (was Re: trace-forms macro on the clojure mailing list)

2011-09-27 Thread Sean Corfield
Thank you Luc! On Tue, Sep 27, 2011 at 11:44 PM, Luc Prefontaine wrote: > First shot of tools.trace is now available on github: > > http://github.com/clojure/tools.trace > > As for the traceforms macro, you will notice that when an exception is > trapped, I recompose > an new exception with the

Re: suggestion for clojure development

2011-09-27 Thread Sean Corfield
On Wed, Sep 28, 2011 at 12:03 AM, Arthur Edelstein wrote: > You may think > I'm doing it wrong, but I don't think I'm alone at all. I don't think you're doing anything wrong - and I'm sure many people only do minimal research on tools they use. I just think your expectations of Clojure the langua

Re: suggestion for clojure development

2011-09-27 Thread Arthur Edelstein
> When you're selecting a library to solve a particular problem, you > normally have to do some research and evaluate more than one library > so, for me, the activity of the project and software versions > supported are part of that necessary research. I can't imagine "just > using" some random lib

tools.trace (was Re: trace-forms macro on the clojure mailing list)

2011-09-27 Thread Luc Prefontaine
Hi, First shot of tools.trace is now available on github: http://github.com/clojure/tools.trace As for the traceforms macro, you will notice that when an exception is trapped, I recompose an new exception with the necessary form traceback information instead of using print. The main reason is

Re: suggestion for clojure development

2011-09-27 Thread Sean Corfield
On Tue, Sep 27, 2011 at 7:33 PM, Arthur Edelstein wrote: > I hope so, too, but very often this doesn't happen in practice. Much > useful code is not maintained. My position on free open source software is that if it's that useful to someone, then that someone has at least some obligation to contr

Re: iterate with side-effect function?

2011-09-27 Thread Nathan Sorenson
Quite often I convince myself I need state or some effectful trigger, but further thought reveals a simpler stateless approach. That being said--if you absolutely need to be doing something based on effects, something that absolutely can't be tracked via values in a purely functional way--like

Re: iterate with side-effect function?

2011-09-27 Thread siyu798
Nathan, Thanks for the explanation, what i'm trying to do is to "repeatedly" run a side-effect function until the return value of it meets certain criteria. It could have been done using loop/recur as shown below, and wondering if there's alternatives. Is a there general approach to accomp

Re: advantage of dynamic typing

2011-09-27 Thread Lee Spector
On Sep 27, 2011, at 3:40 AM, Paul Koerbitz wrote: > That said, I read somewhere (can't find the link now, sorry) that > compile-time type checking in Lisps is difficult because they allow code > generation at run time? That would still leave the possibility to apply it to > everything which is

Re: suggestion for clojure development

2011-09-27 Thread Stuart Halloway
> I hope so, too, but very often this doesn't happen in practice. Much > useful code is not maintained. > > If I add a dependency from Clojars or maven central to my project.clj > file, I don't want to pay the tax of deciding what Clojure version it > is and whether it is actively maintained, Clo

Re: Clojurescript output effect

2011-09-27 Thread Brent Millare
Also as for compile options, there are none. I initially tried advanced, but again got a blank page. So I tried no args, and it made the "out" folder. I looked in there and saw the generated js file. I looked through that, and edited each line to look like my working js code. In the end, translatin

Re: suggestion for clojure development

2011-09-27 Thread Arthur Edelstein
On Sep 27, 4:43 pm, Sean Corfield wrote: > On Tue, Sep 27, 2011 at 4:28 PM, Brian Marick wrote: > > I think "is it actively maintained?" is not a particularly interesting > > question for a community. The question is: "is this a useful library?" > > Then: "is the original author maintaining it?

Re: trace-forms macro

2011-09-27 Thread Luc Prefontaine
Fine, I merged the new version and I will add a couple of tests related to these changes. Luc On Mon, 26 Sep 2011 18:46:12 +0200 Jonathan Fischer Friberg wrote: > I looked at it today and have updated the macro. > (same gist: https://gist.github.com/1209498) > > Additions: > It detects if a f

Re: iterate with side-effect function?

2011-09-27 Thread Nathan Sorenson
Because the fn is wrapped in a lazy sequence, the effects won't run if you ask for the same value again-- For instance: (def a (iterate (fn [cnt] (prn cnt) ;; save data to csv (inc cnt)) 0)) (nth a 5) ... all the effects are fired. (nth a 5) ...

Re: suggestion for clojure development

2011-09-27 Thread Phil Hagelberg
On Tue, Sep 27, 2011 at 4:43 PM, Sean Corfield wrote: > The pain of migrating from Contrib 1.2.0 (or earlier) to the New > Contrib Libraries (whether you stay on Clojure 1.2.x or move to > Clojure 1.3.0) is a one-time "tax" for early adopters and, as > unpleasant as that may be, I expect future mi

Re: suggestion for clojure development

2011-09-27 Thread Sean Corfield
On Tue, Sep 27, 2011 at 4:28 PM, Brian Marick wrote: > I think "is it actively maintained?" is not a particularly interesting > question for a community. The question is: "is this a useful library?" Then: > "is the original author maintaining it?" And then, if not: "who will pick it > up?" Wel

Re: statistics library?

2011-09-27 Thread Lee Spector
On Sep 27, 2011, at 5:44 PM, David Powell wrote: > I see that there was a recent fix made to Incanter: > > Fixed typo in :lower-tail? keyword. > This was causing the complement of the p-value to be returned. > > https://github.com/liebke/incanter/pull/39 > > > Have you tried the latest versio

Re: suggestion for clojure development

2011-09-27 Thread Brian Marick
On Sep 27, 2011, at 5:18 PM, Sean Corfield wrote: > Are therein lies the problem: if they are not actively maintained, > you're not going to get bug fixes even on Clojure 1.2. I think "is it actively maintained?" is not a particularly interesting question for a community. The question is: "is

Re: Clojurescript output effect

2011-09-27 Thread Brent Millare
You can try out the code I posted, but basically I wanted to create a hello world canvas. Without the require, I get the canvas. With the require, I get a blank white page. There isn't any error message, which is what made this particularly difficult to narrow. -Brent On Sep 27, 7:01 pm, David N

Re: Clojurescript output effect

2011-09-27 Thread David Nolen
What was the error and what were your compile options? On Tuesday, September 27, 2011, Brent Millare wrote: > I'm trying to figure out why when I require('cljs.core') in a > javascript file, the hello world example doesn't work. > > hello.js > goog.require('cljs.core'); ;;<--- If I

Clojurescript output effect

2011-09-27 Thread Brent Millare
I'm trying to figure out why when I require('cljs.core') in a javascript file, the hello world example doesn't work. hello.js goog.require('cljs.core'); ;;<--- If I delete this line, then everything works. goog.require('goog.dom'); function sayHi() { var myc__2284 = goog.dom.cre

iterate with side-effect function?

2011-09-27 Thread siyu798
Hi, From clojure doc, it states iterate takes a side-effect free function, and what's the implication if the function has side-effect as follow? (->> 0 (iterate (fn [cnt] (prn cnt) ;; save data to csv (Thread/sleep 6000) (inc cn

Re: suggestion for clojure development

2011-09-27 Thread Sean Corfield
On Tue, Sep 27, 2011 at 11:57 AM, Arthur Edelstein wrote: > raises the question of what happens to all of the many existing > Clojure 1.2-based libraries in Clojars and on github. Many of these > are very useful, but not necessarily actively maintained. A lot of Are therein lies the problem: if t

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Andreas Kostler
This is quite amusing since the first reply to the original post already provided the correct answer :) On Sep 28, 2011 6:05 AM, "Michał Marczyk" wrote: > Hi Ru, > > let's input your macro definition at the REPL: > > user> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#))) > #'user/infix > > S

Re: statistics library?

2011-09-27 Thread David Powell
> Again, if I understand correctly, under no circumstances should the p-value > ever be outside of the range from 0 to 1. It's a probability, and no value > outside of that range makes any sense. But Incanter sometimes returns > p-values greater than 1. I see that there was a recent fix made to

documentation problem with Atom

2011-09-27 Thread Robert McIntyre
Just wanted to report that the documentation for atom misspells "become" as "be come" --Robert McIntyre -- 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 ar

Re: suggestion for clojure development

2011-09-27 Thread Andreas Kostler
I'm with Phil on that one. Legacy support slows or even hinders innovation. On Sep 28, 2011 6:06 AM, "Phil Hagelberg" wrote: > On Tue, Sep 27, 2011 at 11:57 AM, Arthur Edelstein > wrote: >> So my request for Clojure's future development, is that backwards >> compatibility not be broken. This mean

Re: statistics library?

2011-09-27 Thread labwork07
Yes, those errors in Incanter are unfortunate. I had another weird one occurred which David Liebke attributed to the underlying Colt library. user=> (sd (repeat 9 0.65)) NaN The sd function calls the variance function, which calls a function in Colt; the trouble is Colt is returning a number ve

October Amsterdam Clojure

2011-09-27 Thread Hubert Iwaniuk
Good news everyone! * tl;dr -> http://bit.ly/ams-clj On Wednesday, October 12th Amsterdam Clojurians is organizing October Amsterdam Clojure. Same as last year, we are proud to have a great speaker: Uncle Bob Martin. Sourcesense.com is our proud sponsor and made it possible to host the event i

Re: suggestion for clojure development

2011-09-27 Thread Phil Hagelberg
On Tue, Sep 27, 2011 at 11:57 AM, Arthur Edelstein wrote: > So my request for Clojure's future development, is that backwards > compatibility not be broken. This means that Clojure code needs a way > of designating what Clojure version it is targeted for. Then, for > example, the Clojure 1.4 jar s

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Michał Marczyk
Hi Ru, let's input your macro definition at the REPL: user> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#))) #'user/infix So far so good. Now let's try use it in a function: user> (defn foo [] (infix (5 + 4))) #'user/foo Well now -- it compiled! So, there's no exception being thrown when

Re: [ANN] Clojure 1.3 Released

2011-09-27 Thread Sean Corfield
On Tue, Sep 27, 2011 at 12:22 PM, Bruce Durling wrote: > That is great to hear. So happy to see someone use a lot of clojure in > production. Congrats on the release. Thanx. You can get a lot done with just a little Clojure. We stand at 1,829 lines of production Clojure code and 448 lines of unit

Re: Does macros evaluates its arguments before?

2011-09-27 Thread ru
Alan, Please forgive me. I am very sorry. May be my English is not so good. Simply, I stupidly kept the idea that macro differs from the function in that is evaluated twice, the first time with the unevaluated arguments. When I saw that even in Lisp it is not the case, I gave up : ( Sincerely,

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-09-27 Thread Volker Schlecht
s/repl/repljs/ -- 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, send

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-09-27 Thread Volker Schlecht
Hi Paul, sorry, I was blindly assuming you were starting a browser repl without hooking it up with a browser :) Reversing your posts, that becomes clear ... What happens when you do the following M-x set-variable enter: inferior-lisp-program enter: "/path/to/repl/script" M-x inferior-lisp ?

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Alan Malloy
It seems you are enjoying spewing accusations at Clojure, but if your goal is to actually get something done, you would get a lot more out of this discussion if your attitude were "Huh, I expected x but see y! Is that a bug or am I wrong? Oh I see, it's not a bug? I still don't understand, please e

Re: [ANN] Clojure 1.3 Released

2011-09-27 Thread Bruce Durling
Sean, On Tue, Sep 27, 2011 at 20:17, Sean Corfield wrote: > On Fri, Sep 23, 2011 at 2:44 PM, Christopher Redinger > wrote: >> We are pleased to announce today the release of Clojure 1.3: > > We took Clojure 1.3 into production today, along with a lot more > Clojure code compared to our previous

Re: [ANN] Clojure 1.3 Released

2011-09-27 Thread Sean Corfield
On Fri, Sep 23, 2011 at 2:44 PM, Christopher Redinger wrote: > We are pleased to announce today the release of Clojure 1.3: We took Clojure 1.3 into production today, along with a lot more Clojure code compared to our previous production release. We've converted all of our profile publishing and

suggestion for clojure development

2011-09-27 Thread Arthur Edelstein
Dear Everyone, I would like to make a suggestion for the future of Clojure, and hopefully prompt a discussion. My comment comes as a result of my experience trying to port code to 1.3. I have run into numerous problems, most of which come from 1.3's incompatibilities with my 1.2- targeted code and

Re: can't see the error

2011-09-27 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 27.09.2011 06:27, schrieb Baishampayan Ghose: >> i wasn't really trying to achieve anything useful - just messing >> around and see where i get. >> >> now i'm here: (defrecord point [x y z]) (defn genPoints [n] (let >> [random (new Random) randomI

Re: Does macros evaluates its arguments before?

2011-09-27 Thread David Nolen
2011/9/27 ru > All, I give up! :) You're macro will still be incorrect in CLISP, SBCL, CMUCL, Clozure MCL, ABCL, MIT Scheme, Gambit Scheme, Chicken, Ikarus, Racket etc. ;) David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: Does macros evaluates its arguments before?

2011-09-27 Thread ru
i i i i i i i ooooo o o I I I I I I I 8 8 8 8 8 o 88 I \ `+' / I 8 8 8 888 \ `-+-' / 8 8 8 o 8 `-__|__-'8 8

Re: statistics library?

2011-09-27 Thread Lee Spector
On Sep 27, 2011, at 1:37 PM, Johann Hibschman wrote: > Johann Hibschman writes: > >> There may be an easier way to do this, but this worked for me: >> >> user=> (org.apache.commons.math.stat.inference.TestUtils/tTest >>(into-array Double/TYPE [40 5 2]) (into-array Double/TYPE [1 5 1])) >>

Re: defrecord and overriding "empty"

2011-09-27 Thread David Nolen
On Tue, Sep 27, 2011 at 1:54 PM, Nathan Sorenson wrote: > Should IPersistentCollection even be defining 'empty', if one of the > language's key data types doesn't support it? I think it would be better to > either pull 'empty' into it's own protocol so clojure.walk doesn't match on > IPersistentC

Re: defrecord and overriding "empty"

2011-09-27 Thread Nathan Sorenson
You're right that my use isn't strictly returning a collection with a size of zero-- I'm treating empty more like 'default'. I'm thinking of its use in clojure.walk, which simply creates a "blank" version of an arbitrary collection in which to place the altered sub-forms. I can't find any other

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Mark Rathwell
> In this point I want to cite Clojure doc, that say nothing about > expansion and runtime,  once more: "..If the operator of a call is a > symbol that names a global var that is a macro function, that macro > function is called and is passed the /unevaluated/ operand forms. " > So, when I write th

Re: Does macros evaluates its arguments before?

2011-09-27 Thread David Nolen
2011/9/27 ru > > user=> (defmacro infix [e] `(let [[x# f# y#] ~e] (f# x# y#))) > #'user/infix > user=> (infix (5 + 4)) > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.lang.IFn (NO_SOURCE_FILE:0) > > I insist that expansion is not quite correct. Am I right? Your mac

Re: statistics library?

2011-09-27 Thread Johann Hibschman
Johann Hibschman writes: > There may be an easier way to do this, but this worked for me: > > user=> (org.apache.commons.math.stat.inference.TestUtils/tTest > (into-array Double/TYPE [40 5 2]) (into-array Double/TYPE [1 5 1])) > 0.3884493044983227 I should have used (double-array [40 5 2

Re: Does macros evaluates its arguments before?

2011-09-27 Thread ru
On 27 сен, 16:45, Mark Rathwell wrote: > > And in this case Closure compiler behave itself also unpredictably and > > quite the contrary: > > Where it must evaluate a symbol (like in this case), it doesn't. > > Symbols need to be namespace resolved in order to be evaluated > properly.  This is s

Re: statistics library?

2011-09-27 Thread Johann Hibschman
Lee Spector writes: > I need to do some pretty simple statistics in a Clojure program and > Incanter produces results that I think must be wrong (details > below). So I don't think I can trust it. I agree, those all look weird to me. > Is there other code for statistical testing out there? I'd

Re: Shameless self promotion - JavaOne

2011-09-27 Thread Aaron Bedra
On a similar note, I will also be at J1 representing Clojure in the script bowl. It is wednesday morning at 8:30. The audience chooses the winner, so if you are at J1 and want to support Clojure, you have your chance! Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 09/27/2011 11

Re: defrecord and overriding "empty"

2011-09-27 Thread David Nolen
The problem is what does empty mean in the context of defrecord? A new instance of a defrecord is not "empty", it has those fields and they are set to nil. David On Tue, Sep 27, 2011 at 3:48 AM, Nathan Sorenson wrote: > I'm using clojure.walk/postwalk to rewrite terms in nested data > structure

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread tmountain
> Is there a > way to do this in a single HTML file, and include all of the tooltips in > that file? Yes, there is. There are a lot of options out there, but I've found qTip to be pretty simple. http://craigsworks.com/projects/qtip/demos/content/basic If you don't want to use any third-party lib

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Andy Fingerhut
Pardon my ignorance -- I've not done anything with AJAX before. Is there a way to do this in a single HTML file, and include all of the tooltips in that file? If so, do you have an example of this I could use to learn from? Just two or three links each with different tooltips would be enough to

statistics library?

2011-09-27 Thread Lee Spector
I need to do some pretty simple statistics in a Clojure program and Incanter produces results that I think must be wrong (details below). So I don't think I can trust it. Is there other code for statistical testing out there? Or maybe somebody could explain to me how to interpret the seemingly

Shameless self promotion - JavaOne

2011-09-27 Thread Dennis
Hey guys, I will be giving a talk at JavaOne (it is Clojure related). Here is the information. Title: Monitoring a Large-Scale Infrastructure with Clojure Time Tuesday, 07:30 PM, Parc 55 - Embarcadero Length 45 Minutes Abstract: Monitoring a large infr

Re: trace-forms macro

2011-09-27 Thread Michał Marczyk
On 26 September 2011 18:46, Jonathan Fischer Friberg wrote: > To Marczyk: > Sure, where to? Great, thanks! The relevant details are available on this page: http://clojure.org/contributing There's a one-page form to print out, sign and send off to Rich by snail mail. Once it's processed, your n

Re: Does macros evaluates its arguments before?

2011-09-27 Thread Mark Rathwell
> And in this case Closure compiler behave itself also unpredictably and > quite the contrary: > Where it must evaluate a symbol (like in this case), it doesn't. Symbols need to be namespace resolved in order to be evaluated properly. This is something you need to be aware of, but it is not unpre

New Clojure Brush for Alex Gorbatchev's SyntaxHighlighter

2011-09-27 Thread J . Pablo Fernández
Hello, I took Travis Whitton's brush for Clojure[1] for Alex Gorbatchev's SyntaxHighlighter[2] and put it in a git repo in GitHub, with an index file to easy development and trying it out. I also fixed some bugs and did some improvements. The new code is here: https://github.com/pupeno/clojure

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Ohh... And it would be nice if hovering with mouse pointer on function name in cheetsheet would show tool tip (made with AJAX; the results would be cached; thought about clojurescript - its a high time to proof its usability) with functions description and signature and after clicking link "mor

Re: Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Btw. Cheat Sheet doesn't look good on iPad. Some columns are shifted -- 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

Clojure v1.4 - what is new, changed and in development

2011-09-27 Thread Michael Jaaka
Hi! I would be nice If after entering on http://clojure.github.com/clojure/branch-master/index.html I could see what is new, what has changed (just bold new methods, cross the removed one and skew the changed one) links and what new concepts are in progress. I think that it is easy to do. For

docs for 1.3

2011-09-27 Thread Sergey Didenko
Is the README file from Clojure on github the best 1.3 documentation for the moment? For example, I can't find a mention of "Factory function taking a map" , e.g. map->MyRecord on the main clojure.org -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Does macros evaluates its arguments before?

2011-09-27 Thread ru
You are right, Alan! And in this case Closure compiler behave itself also unpredictably and quite the contrary: Where it must evaluate a symbol (like in this case), it doesn't. Where it mustn't evaluate a symbol (argument of macro), it does. So, need to have comprehensive and profound knowledge ab

Re: advantage of dynamic typing

2011-09-27 Thread Paul Koerbitz
Hi Nathan, thanks for the pointer, this is great! I got his dissertation, this does seem like a great starting point given that he is the guy behind typed racket. The wikipedia page on sequent calculus also looks promising, let's see how far I'll make it ;) Thanks for the pointer Paul On Sep 27,

Re: advantage of dynamic typing

2011-09-27 Thread Nathan Sorenson
I am following the general strategy described in Sam Tobin-Hochstadt's work. He is the person behind typed-racket. His Phd dissertation[1] has an overview of the area of gradual/soft/refinement typing in dynamic languages. It's a good place to start, with a pretty gentle introduction to the motivat

defrecord and overriding "empty"

2011-09-27 Thread Nathan Sorenson
I'm using clojure.walk/postwalk to rewrite terms in nested data structures. However, I am unable to do this with types as defined by defrecord, because they specify that the function "empty" throw a not- implemented exception. If I were able to over-ride this default implementation of 'empty' I b

Re: advantage of dynamic typing

2011-09-27 Thread Paul Koerbitz
Hi Nathan! I am very intrigued by your approach. I would love to contribute, my problem is that I don't know the first thing about type inference systems (as in how they work on the inside). Do you have a good reference here? I'll take a look at what you've done, maybe bother you with some questio

Re: advantage of dynamic typing

2011-09-27 Thread Paul Koerbitz
Javier, Nathan +1 I think type systems such as Haskells (and presumably Scala's FP stuff, don't know anything about that) are really the way to go if you want static typing. I think the extra safety that it provides you with is really beneficial and for most things Haskells type system feels prett

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-09-27 Thread Paul Koerbitz
Hi Volker, not sure I understand you correctly. You should still be able to type into the repl and get results, even if it is 'in-browser', right? At least that works for me if I start the browser repl on the command line. So it should also work in Emacs, I am pretty sure its something weird with