newbie code (genetic programming) and questions (dev environments)

2010-02-28 Thread Lee Spector
a way to get around this? Thanks to everyone here for developing what seems to be a great new language! -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspec...@hampshire.edu, http://hampshire.edu/lsp

Re: newbie code (genetic programming) and questions (dev environments)

2010-03-01 Thread Lee Spector
nd email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspec...@hampshire.ed

Re: newbie code (genetic programming) and questions (dev environments)

2010-03-01 Thread Lee Spector
> On 28 February 2010 21:38, Lee Spector wrote: > [...] >> - When I run clj (from the most recent ClojureX) on the command line with -i >> and a source file it runs the file but then hangs. If I also specify -r then >> I get a REPL after the file runs, which is nice, but

Re: newbie code (genetic programming) and questions (dev environments)

2010-03-01 Thread Lee Spector
n Feb 28, 2010, at 10:45 PM, Terje Norderhaug wrote: > On Feb 28, 2010, at 11:38 AM, Lee Spector wrote: >> On the development environment front: Is anyone contemplating creating a Mac >> OS X "Clojure in a Box"? I would be an enthusiastic user. If it could have >>

shared state/structure and concurrency

2010-03-15 Thread Lee Spector
this is all probably pretty naive -- it's my first foray into this kind of concurrent programming -- but I'd appreciate any advice or pointers that you can provide. Thanks, -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West

help with infinite loop: break and examine stack? dynamic tracing? circular lists?

2010-03-17 Thread Lee Spector
if they are indeed possible. I realize that copying is generally not necessary in Clojure because of immutability, but if one wants to copy a list how can one do it? Thanks for your patience in reading this. I'd appreciate any feedback on any parts of it. And in spite of the problems listed

Re: help with infinite loop: break and examine stack? dynamic tracing? circular lists?

2010-03-17 Thread Lee Spector
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 email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/

Re: help with infinite loop: break and examine stack? dynamic tracing? circular lists?

2010-03-17 Thread Lee Spector
ment! -Lee On Mar 17, 2010, at 2:04 PM, Terje Norderhaug wrote: > On Mar 17, 2010, at 8:14 AM, Lee Spector wrote: >> The root problem is that I think I have an infinite loop somewhere in my >> code and I'm having a hard time tracking it down. [...] In Common Lisp I

Re: help with infinite loop: break and examine stack? dynamic tracing? circular lists?

2010-03-17 Thread Lee Spector
p, 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 email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.

Re: Why I have chosen not to employ clojure

2010-03-21 Thread Lee Spector
;> > > -- > 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: Why I have chosen not to employ clojure

2010-03-22 Thread Lee Spector
to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > To unsubscribe from this group, send email to > clojure+unsubscribegooglegroups.com or reply to this email with the words > "REMOVE ME&q

Re: Why I have chosen not to employ clojure

2010-03-22 Thread Lee Spector
;> > > definitely a hurdle) >> > >> > > martin >> >> > > -- > 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 th

Re: Why I have chosen not to employ clojure

2010-03-22 Thread Lee Spector
ure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > To unsubscribe from this group, send email to > clojure+unsubscribegooglegroups.com or reply to this email with the words > "REMOVE ME" as the subjec

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Lee Spector
hat posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > To unsubscrib

Re: ANN: labrepl, making Clojure more accessible

2010-03-24 Thread Lee Spector
d 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 email to > clojure+unsubscr...@goog

concurrency and rand-int

2010-03-25 Thread Lee Spector
less (always generating numbers by scrambling the clock?). But I would hope there would be something simpler. Thanks, -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspec...@hampshire.edu, http://hampshire.edu

Re: concurrency and rand-int

2010-03-26 Thread Lee Spector
(nth @rand-seq-ref 100) ;; pre-cache random values; evaluate it >>> every some time >>> ;;btw, how to do it automatically? >> >>> (defn next-rand-val [] >>> (dosync (commute rand-seq-ref next) (first @rand-seq-ref))) >> >>> user=> (next-r

Re: concurrency and rand-int

2010-03-26 Thread Lee Spector
f binding some months ago: > > http://muckandbrass.com/web/display/~cemerick/2009/11/03/Be+mindful+of+Clojure%27s+binding > > On a very minor note, these forms are more syntactically idiomatic: > > (java.util.Random.) > (.nextFloat random-state) > (.nextInt random-state

Re: concurrency and rand-int

2010-03-26 Thread Lee Spector
(nth @rand-seq-ref 100) ;; pre-cache random values; evaluate it >>> every some time >>> ;;btw, how to do it automatically? >> >>> (defn next-rand-val [] >>> (dosync (commute rand-seq-ref next) (first @rand-seq-ref))) >> >>> user=> (next-rand

another concurrency question: could there be contention for allocation (consing etc.)?

2010-03-26 Thread Lee Spector
rying about contention for the random states, which I think I've now made thread local, but now I wonder if the contention might be in the allocation. Possible? If so, then is there a way around it? Thanks, -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science,

Re: another concurrency question: could there be contention for allocation (consing etc.)?

2010-03-27 Thread Lee Spector
e case by >> default), then generating significant garbage will result in >> not-insignificant GC pauses. Allocation itself isn't a synchronous >> operation, but the default GC is. >> >> Most java profilers have thread-related tools that allow you to see on

Re: another concurrency question: could there be contention for allocation (consing etc.)?

2010-03-27 Thread Lee Spector
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 email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups

Re: Reorder a list randomly?

2010-04-04 Thread Lee Spector
googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=e

Re: Reorder a list randomly?

2010-04-04 Thread Lee Spector
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

Re: Reorder a list randomly?

2010-04-04 Thread Lee Spector
bscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > > To unsubscribe, reply using "remove me" as the subject. -- Lee Spector, Professor of Computer Science Sc

confusing error from rand-int

2010-04-29 Thread Lee Spector
want randomness (but I've turned that off for now anyway to track down this problem). Any comments would be greatly appreciated. Thanks, -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspec...@hampshir

Re: confusing error from rand-int

2010-04-29 Thread Lee Spector
thing. On Apr 29, 2010, at 8:50 AM, Timothy Pratley wrote: > Hi Lee, > > On 29 April 2010 22:31, Lee Spector wrote: > The error that I get is: > > Caused by: java.lang.IllegalArgumentException: n must be positive >at java.util.Random.nextInt(Random.java:250) >

rand-int with bignums

2010-04-30 Thread Lee Spector
o really do the right thing and return a random integer between 0 (inclusive) and n (exclusive), even if n is a bignum? - If there's a reason that rand-int shouldn't do this then is there another straightforward way get the same effect, maybe with some java library that I don't know

Re: rand-int with bignums

2010-05-01 Thread Lee Spector
out how to write a real random bignum generator. -Lee On Apr 30, 2010, at 10:56 PM, Lee Spector wrote: > > In an earlier thread, in which I learned (from Timothy Pratley) that (. (new > java.util.Random) X) gives an error if X is a bignum, I said that at least > Clojure's ran

Re: How can we replace an element in a deeply nested list?

2010-05-14 Thread Lee Spector
your purpose there is better fit: postwalk-replace > > http://richhickey.github.com/clojure/clojure.walk-api.html#clojure.walk/postwalk-replace > > Greetings. > -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 0100

Re: Having trouble with a genetic program

2010-05-23 Thread Lee Spector
ogle > 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 email to > clojure+unsubscr...@google

Re: Having trouble getting full performance from a quad-core with trivial code

2010-05-30 Thread Lee Spector
our cores. > > Here are the tests and results: http://gist.github.com/418631 > > I'd appreciate it if anybody could > > a. point out any problems with my code that might be hurting > performance > b. try this out on your own 3+ core machine and see if you have better >

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Lee Spector
On May 27, 2013, at 5:53 PM, Mark Engelberg wrote: > I would be a lot happier with the state of Clojure debugging if, in addition > to a stacktrace, I could easily explore the local variables in play when an > error was triggered. It was possible to do this in earlier Clojure > environments,

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Lee Spector
On May 27, 2013, at 9:54 PM, Softaddicts wrote: > Lets take a real life example, [etc.] > > Debugging was not a viable option. [etc.] > > This project was extreme in this regard but it prove to me that reviewing > code offline > and thinking about how to improve it gives much more payback than

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 8:43 AM, dgrnbrg wrote: > There's not much you can do to retrieve the locals around an exception with > adding a Java Agent. REDL is able to get the locals around uses of > redl.core/break, since it's a macro and that's an ability of macros. In Common Lisp exceptions are han

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 27, 2013, at 8:31 PM, Charles Harvey III wrote: > If you haven't tried out Light Table, it shows you the values of local > variables. It is a pretty nice feature. > I love the ideas behind LightTable and I check it out from time to time. Checking it out now, though, regarding this issu

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 10:32 AM, Rostislav Svoboda wrote: > This might not be the proper example: If (/ 2 n) throws "Divide by > zero" then "n == zero" Well yes of course it's obvious what the problem is in this case! The point is that if the "bad" function was more complicated then might help to

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 12:37 PM, Cedric Greevey wrote: > > I think locals clearing is simply incompatible with ever having full debug > info at an error site without anticipation of an error at that site, and with > anticipation you can put debug prints, logging, watchers, and suchlike at the > s

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:16 PM, Ben Mabey wrote: > > You can disable locals clearing with a compiler flag. nrepl-ritz even has > helper function that will compile the given form using that flag. If you > want to disable locals clearing on a project wide basis you can do so with > lein's JVM opt

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:38 PM, Cedric Greevey wrote: > What about logging aggressively but also aggressively dumping older log > entries? Keep only, say, the last 100 or 1000 entries. Something like: [etc.] Thanks Cedric. That does indeed seem feasible. In my applications, for example, I might a

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:40 PM, Ben Mabey wrote: > > The flag is a system property: > "-Dclojure.compiler.disable-locals-clearing=true". So you can add that > string to your project.clj's :jvm-opts if you are using lein. This will, of > course, slow down your program but when I've used it in the

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 4:01 PM, Ben Mabey wrote: > > To do this I have been using nrepl-ritz's 'M-x > nrepl-ritz-break-on-exception'. If you are using emacs and haven't looked > into ritz I would highly encourage taking the time to do so. It is painless > to install these days and you can watch

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 5:10 PM, Alan Malloy wrote: > > The principal problem of disabling locals-clearing is not "slowing things > down", but rather causing perfectly reasonable code to consume unbounded > memory. For example, consider: ((fn [xs] (nth xs 1e8)) (range)). With locals > clearing, th

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
A couple more replies to comments on this thread: On May 28, 2013, at 5:50 PM, Cedric Greevey wrote: > > Clojure just doesn't make what he asked for easy, by its nature. Designing to > minimize difficulty with reproducing any observed behavior seems to be > indicated (and desirable for other r

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread Lee Spector
On Jun 4, 2013, at 4:13 PM, Andrea Chiavazza wrote: > Alpacas is an application that displays Clojure source code with forms shown > as nested boxes, doing away with parenthesis altogether. FWIW somewhat related ideas go back a couple of decades. Some pointers can be found at http://www.cs.umd

Re: Best IDE

2013-06-06 Thread Lee Spector
On Jun 5, 2013, at 11:12 AM, Catonano wrote: > My 2 cents: > > it´s ture that the Emacs features are not discoverable and that the learning > curve is mean. > > But it also true that once you´ve done it, it brings you a great value. > > My suggestions about Emacs: > > 1) ... > 2) ... > 3) ..

Re: Best IDE

2013-06-07 Thread Lee Spector
On Jun 7, 2013, at 4:36 PM, Terje Norderhaug wrote: > > MCLIDE is alive and well. Although the most recent public build was released > last summer, there are open source on github for those that want to > participate in the development: > >https://github.com/TerjeNorderhaug/mclide Thanks

Re: translating Common Lisp to Clojure?

2013-06-16 Thread Lee Spector
On Jun 16, 2013, at 8:27 AM, Rich Morin wrote: > This is undoubtedly an open-ended (and probably naive) question, but I'm > wondering > how much of the task of translating Common Lisp code into Clojure could be > done by > a program and how useful (eg, idiomatic) the result would be. > > I ca

Re: I'm starting to wonder if I'm the only person using clooj ...

2013-06-27 Thread Lee Spector
I use it, as do many of my students. I also cheerlead for it here and there occasionally because I think that it occupies a unique sweet spot in the Clojure ecosystem, combining substantial, useful functionality (even if one must sometimes augment it with command line calls to lein) with elegan

Re: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Lee Spector
On Jun 28, 2013, at 4:53 AM, Rich Morin wrote: > > That said, I'm also very interested in Light Table, which appears to be > developing rapidly into an open framework for IDE experimentation. So, > I'm wondering whether it might be easier and more productive (over the > long term) to create some

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 2:27 PM, Gary Trakhman wrote: > We should scour clojuresphere for uses of 'use' and automatically post github > issues to the projects of interest, and redefine the ns macro to issue a > warning with use. > > Does anyone actually like 'use'? > > Require is always more e

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 3:06 PM, Gary Trakhman wrote: > Yea, I have a single namespace with project-specific common utilities which I > refer to as u/some-util-function. For me, it's a bit scary to have implicit > symbols in scope. A typo can make a local binding refer to something that > might

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Lee Spector
On Jul 23, 2013, at 4:43 PM, Gary Trakhman wrote: > > For instance, we have defrecords now, no one's going to reach for defstruct > because records are documented and promoted more thoroughly. FWIW I'm even a contrarian on defstruct :-! although I've switched to records anyway on account of

Re: Can we please deprecate the :use directive ?

2013-07-24 Thread Lee Spector
On Jul 24, 2013, at 2:40 AM, Baishampayan Ghose wrote: > > For that use-case, you can always use something like (:require the-ns > :refer :all). Thanks for the clarity BG. I guess if/when it becomes necessary I'll convert all of my (:use the-ns) to (:require the-ns :use :all), although I don't

Re: Can we please deprecate the :use directive ?

2013-07-24 Thread Lee Spector
On Jul 24, 2013, at 9:35 AM, Laurent PETIT wrote: > You (and to some extent me) can easily play with both forms. > But why both forms ? That's curse of knowledge in action, because this > will make no sense at all for newcomers, and there's no good reason > for having both, except historical ones.

Re: Can we please deprecate the :use directive ?

2013-07-24 Thread Lee Spector
On Jul 24, 2013, at 12:45 PM, dennis zhuang wrote: > I am using ':use' for my own namespaces.I know it's discouraged, but if i can > control my own code,why not? Compiler can give me warnings and i process all > warnings carefully. I agree. But I do now see that it's really just about as good,

Re: is intellij idea a good ide for clojure development?

2013-07-25 Thread Lee Spector
On Jul 25, 2013, at 3:37 PM, Sean Corfield wrote: > > In October 2011, I decided to give Emacs another chance - specifically > for Clojure development - and that's what I use day-in, day-out. I > have a slightly customized setup but it really doesn't have much > beyond the starter kit, rainbow de

Re: is intellij idea a good ide for clojure development?

2013-07-25 Thread Lee Spector
On Jul 25, 2013, at 8:22 PM, Anand Prakash wrote: > Would agree with Laurent. For newbies, I would not recommend anything apart > from Eclipse. For real newbies I'd second the earlier mention of clooj. It's really the simplest thing to get and use that integrates a Clojure-aware editor and a

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Lee Spector
On Jul 26, 2013, at 3:02 AM, Andrew Inggs wrote: > On 25 July 2013 21:55, Lee Spector wrote: >> For Sean or anyone who finds Sean's narrative compelling (I do), imagine >> emacs without the learning curve! I say it's possible and I point to the >> long-ext

Re: is intellij idea a good ide for clojure development?

2013-07-26 Thread Lee Spector
PS, I wrote: > but I don't know of any projects dedicated to providing a complete > emacs-based Clojure environment with the usability and lack of learning curve > of FRED. I *do* know about https://mclide.com and https://github.com/TerjeNorderhaug/mclide, and it's author Terje Norderhaug

Re: Interest in a commercial IDE for Clojure?

2013-07-27 Thread Lee Spector
On Jul 27, 2013, at 7:54 AM, Colin Fleming wrote: > One problem is that the IDE space is already fairly fractured - there's Emacs > and CCW, Clooj, Sublime Text and the promise of Light Table at some point, > and of course the current public version of La Clojure. But there's still not > a grea

help actually changing :use to :require :refer :all?

2013-07-27 Thread Lee Spector
I'm trying to actually change some instances of :use to :require :refer :all, as urged by several people here, and it's not as simple as I had hoped. Or I'm missing something obvious. If I have a simple little project containing a namespace declared as follows: (ns use2require.core (:use [us

Re: help actually changing :use to :require :refer :all?

2013-07-27 Thread Lee Spector
On Jul 27, 2013, at 1:25 PM, Laurent PETIT wrote: >> >> But it's really not much better. This too will explode the number of lines >> in many of my ns declarations. >> >> Is there indeed a reasonably concise way to do this? What is it? > > Would it still bother you if the IDE helped maintain t

Re: help actually changing :use to :require :refer :all?

2013-07-27 Thread Lee Spector
On Jul 27, 2013, at 7:44 PM, Colin Fleming wrote: > BTW Lee, going back to your original question, I think the solution that you > came up with is the only one I can think of that does what you want. Of > course you can put it on one line: > > (ns use2require.core > (:require [use2require [my

Re: help actually changing :use to :require :refer :all?

2013-07-27 Thread Lee Spector
On Jul 27, 2013, at 3:49 PM, Laurent PETIT wrote: > > Here's how I see it: it would change the ns declaration depending on > the choices you make in the code completion list. That is, the code > completion list would have to not only be made of what's already > loaded in the REPL (as is generally

Re: help actually changing :use to :require :refer :all?

2013-07-27 Thread Lee Spector
On Jul 27, 2013, at 8:49 PM, Colin Fleming wrote: > It's true that both Laurent's and my suggestions are complicated, but we're > thinking about it from an implementer's point of view. What I currently have > from a *user's* point of view for classes is great, you just don't think > about it.

Re: [ANN] Nightcode, an IDE for Clojure and Java

2013-08-02 Thread Lee Spector
On Aug 2, 2013, at 9:03 AM, Zach Oakes wrote: > I’ve been working on a simple IDE for the past few months. It started as an > attempt to add Leiningen integration to Clooj, but eventually I decided to > start a new project from scratch. It is very alpha-quality, so please be > gentle: > > htt

Re: [ANN] Nightcode, an IDE for Clojure and Java

2013-08-02 Thread Lee Spector
On Aug 2, 2013, at 1:53 PM, Jeff Heon wrote: > If I can suggest the one feature that I couldn't bear to use an IDE without: > Strict Structural Editing Mode (paredit-style) But please note that while many love paredit, many others hate it -- so if you implement this I would make it optional. Al

Re: Can I refer all but specified symbols with 'ns' macro?

2013-08-02 Thread Lee Spector
On Aug 2, 2013, at 9:16 AM, Laurent PETIT wrote: > 2013/8/2 Anthony Grimes : >> Keep in mind that you should almost never do this. It's much better to >> require :as or explicitly refer which things you want from each namespace. >> When you do :refer :all, you pollute your namespace with tons of v

Re: Can we please deprecate the :use directive ?

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 4:40 AM, Korny Sietsma wrote: > > 3. Use ":refer :all". It's perfectly fine, IMHO, when used responsibly. I agree in principle, but as I mentioned earlier in a related thread, when I actually tried to convert my :use instances to :require :refer :all I learned (I think!) tha

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 12:28 PM, Greg wrote: > Branching off of the "Can we please deprecate the :use directive ?" thread, I > was wondering what the Clojure community thinks of radically simplifying the > "ns" declaration while keeping all of its power. Can you build in a way to get :require :ref

Re: Can we please deprecate the :use directive ?

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 8:15 AM, Mikera wrote: > On Monday, 5 August 2013 11:35:22 UTC+1, Phillip Lord wrote: > Anthony Grimes writes: > > I can't think of a single good reason to not deprecate :use. :require can > > do everything :use could do now. > > Wait for it, wait for it > > > This i

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 12:39 PM, Mark Engelberg wrote: > > I agree that subnamespaces are important. Relatedly, I frequently struggle > with the fact that Clojure's import doesn't support wildcards. When using > Java libraries, very frequently the Java tutorials or library documentation > use w

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 12:41 PM, Greg wrote: >> Can you build in a way to get :require :refer :all to work on a bunch of >> sub-namespaces together on one line, as one currently can with :use, without >> listing each namespace completely on a separate line with a separate :refer >> :all? > > Cert

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 2:14 PM, Timothy Baldridge wrote: > > To quote Rich: "Java packages are not enumerable. The only way to do so is to > walk the classpath/jars etc. I don't think import * is a good idea, as it > brings more into a namespace than you are going to use, making Clojure's > namesp

Re: [ANN] Clotilde is Linda in Clojure.

2013-08-05 Thread Lee Spector
On Aug 5, 2013, at 10:37 AM, François DE SERRES wrote: > 9 months and half a dozen books later, here's my first (hopefully) useful > Clojure program: https://github.com/justiniac/clotilde > > Clotilde implements the basic ops of the Linda process coordination language: > http://en.wikipedia.org

Re: [Proposal] Simplified 'ns' declaration

2013-08-06 Thread Lee Spector
On Aug 6, 2013, at 7:40 AM, Phillip Lord wrote: >> Maybe it's not ideal if Clojure has to walk the classpath, but the >> alternative is that I have to manually walk the classpath and jars myself >> with no idea what I'm looking for. Surely it's better for this to be >> handled through an automat

Re: Can we please deprecate the :use directive (was Re: [Proposal] Simplified 'ns' declaration)

2013-08-06 Thread Lee Spector
On Aug 6, 2013, at 7:55 AM, Curtis Summers wrote: > I agree that wildcards make it "easy" (in the nearness sense), but from a > long-term maintainability standpoint, I'd prefer to have explicit imports as > is. When I'm reading your code a year from now and need to look-up the docs > on a cla

Re: ANN: paredit-widget, simple swing-based clojure paredit widget

2013-08-06 Thread Lee Spector
On Aug 6, 2013, at 2:15 PM, kovas boguta wrote: > Cool! I just cloned the repo and tried it out. Seems to work pretty well. > I just tried it too, mainly to see if there was a way to turn paredit off... and I don't see one. Is there one? I really dislike paredit. Also, is there not a way to e

Re: ANN: paredit-widget, simple swing-based clojure paredit widget

2013-08-06 Thread Lee Spector
On Aug 6, 2013, at 3:51 PM, Zach Oakes wrote: > I'll try adding a way to toggle paredit, but it'll be complicated since I > will probably have to re-create and re-load all open files, unless > paredit-widget provides a way to disable paredit from a JTextArea that > previously had it added. Th

Re: Wrong documentation of contains?

2013-08-07 Thread Lee Spector
On Aug 7, 2013, at 8:22 AM, Jay Fields wrote: > contains? is possibly poorly named, contains-key? would probably have avoided > this entire issue. I'd put it more strongly -- contains? is definitely poorly named, inviting the assumption that it can be used where you really want "some" with a s

Re: IDE feature

2013-08-07 Thread Lee Spector
hink of them, especially when I'm playing with ideas and sketching out code roughly. Your mileage may vary! But that doesn't mean that either of us is doing it wrong. -Lee -- Lee Spector, Professor of Computer Science Cognitive Science, Hampshire College 893 West Street, Amh

Re: IDE feature

2013-08-08 Thread Lee Spector
On Aug 8, 2013, at 3:34 AM, Robert Stuttaford wrote: > Lee has a valid point. Lee's point is: let me decide. Put paredit in, but let > me turn it off if I want. > > I agree that paredit is the only sane way for me and for anyone who doesn't > have Lee's muscle memory to overcome. But for Lee,

Re: IDE feature

2013-08-08 Thread Lee Spector
On Aug 8, 2013, at 8:15 AM, Phillip Lord wrote: >> >> I'm happy to drop this after this message too. I just couldn't let such an >> unnecessarily insulting email stand without a response > > I think he was trying to support you actually. He's saying "it doesn't > work for you, which means it's

Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata

2013-08-09 Thread Lee Spector
On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: > For a pretty decent cover of when and how to use macros, On Lisp[1] is a > pretty good book. It's written mainly for Common Lisp but most of it > translates to Clojure well enough. I find that for common code, writing > macros isn't so useful

structure-related support for editing code as text

2013-08-09 Thread Lee Spector
The recent discussion of paredit reminded me that some Lisp editors have simple features that let you deal with code structurally, in a sense, while also editing it as text and using fairly standard GUI gestures. I haven't seen these yet in the Clojure world. One that I've found helpful is t

Re: Do you like the Clojure syntax?

2013-08-13 Thread Lee Spector
On Aug 13, 2013, at 10:02 AM, Steven Degutis wrote: > That isn't universally true. For me it was the opposite: this syntax made it > easier for my brain to process than any other language, even when I was first > learning it. Maybe my brain is diabetic and just can't handle syntactic > sugar.

Re: Question on mapcat and its variable arity

2013-08-25 Thread Lee Spector
On Aug 25, 2013, at 5:42 PM, ngieschen wrote: > > mapcat's signature is (f & colls) which indicates to me I should be able to > so something like (mapcat #(list (inc %)) [1 2 3] [4 5 6]). That is, doesn't > the & indicate that I can pass in a variable number of colls? However, if I > do, it cr

Re: Dynamically creating defrecord

2015-01-17 Thread Lee Spector
> On Jan 17, 2015, at 12:27 PM, Sven Richter wrote: > > I am trying to create record definitions dynamically during runtime. What I > would like to do is something like this: > > (defn mk-rec [record-name namespace arg-list] > (eval '(do (ns namespace) >(defrecord record-name arg

Re: Dynamically creating defrecord

2015-01-17 Thread Lee Spector
> On Jan 17, 2015, at 6:04 PM, Matching Socks wrote: > > Did you find something really wrong with defstruct? Occasions when the basis > fields are not known to the programmer seem better met by defstruct than > defrecord. And defstruct has not been deprecated in the API documentation. > Th

Re: Is there a way to stop a long running expression in the REPL

2015-02-21 Thread Lee Spector
In case anybody is developing tools for this kind of thing, one of the things I most miss from Common Lisp is the ability to interrupt a running expression AND see the values of locals at the point of interruption. Fantastically useful for debugging. As far as I know there's no environment that

Re: clojure, not the go to for data science

2015-03-30 Thread Lee Spector
> On Mar 30, 2015, at 7:35 AM, Jony Hudson wrote: > > I propose, instead of this discussion, everyone channels their energy into > writing an open-source data-science library, or blog post/article promoting > Clojure for data science. In their favourite editor, of course! > > > Jony That's

Easy-install/GUI emacs for Clojure (was: Re: clojure, not the go to for data science)

2015-03-30 Thread Lee Spector
commend Nightcode for newbies. Both of these are great, and I'm immensely grateful to their developers. But if an emacs-based environment came along with the right usability features (see bullet points below) then I'd almost certainly switch to that. -Lee > On 30.03.2015 15:12, L

Re: State of the Art in Clojure Debugging

2015-03-30 Thread Lee Spector
Thanks for this Bozhidar. I just took a look at clj-debugger and am excited about several of its features, especially the ability to print locals. Does anyone know if it supports (or could easily support -- I'd post an issue if it seems possible) a w

Re: complex numbers in clojure

2015-04-27 Thread Lee Spector
t; 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 email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at &

Re: contains? on String

2015-05-12 Thread Lee Spector
> On May 12, 2015, at 4:28 PM, Fluid Dynamics wrote: > > On Tuesday, May 12, 2015 at 3:34:46 PM UTC-4, Michael Gardner wrote: > On May 12, 2015, at 1:54 PM, Shantanu Kumar > wrote: > > I agree about the counter-intuitiveness. I'm only wondering whether the > > error message is a bit misleadin

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Lee Spector
I'd like to get more guidance on how to specify :jvm-opts for maximum performance. I've received some help on this topic from people on this list in the past (thanks!), but I'm pretty sure that I'm still not doing things right. I'm almost always interested in maximum performance for long-running

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Lee Spector
prove to myself > that these gains were worth it. In my experience the performance bottleneck > is always in design. > > Just my 2p, although with my self-confessed ignoramus status it is more like > 0.5p :). > > On 14 May 2015 21:46, "Lee Spector" <mailto:lsp

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Lee Spector
Thanks Colin and also Alex and Andy. I'm trying to determine a reasonable way to do this without reading a book about it. It sounds like I should use ^:replace, -server, and also -XX:-TieredCompilation (is that right, the way I've changed + to -?), and also -XX:+AggressiveOpts. Does it make se

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Lee Spector
> On May 14, 2015, at 9:15 PM, Fluid Dynamics wrote: > > Umm, the :replace metadata needs to be on the vector. Attaching it to the let > form won't do much of anything useful. So: > > :jvm-opts ~(let [mem-to-use >(long (* (.getTotalPhysicalMemorySize >

  1   2   3   4   5   >