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

2015-05-15 Thread Lee Spector
Thanks Jony -- very helpful! -Lee > On May 15, 2015, at 7:52 AM, Jony Hudson wrote: > > @puzzler -server is the default mostly, but Leiningen overrides some of the > important options that -server enables, as detailed by Alex. > > @Lee the first 15 minutes of this talk by Tom Crayford has so

Re: [ANN] darwin and algebolic - genetic algorithms, and evolving mathematics

2015-05-15 Thread Lee Spector
Fantastic to see this Jony! I look forward to checking it out in detail. Those interested in genetic programming in Clojure might also want to check out: - https://github.com/lspector/gp (minimalist tree-based genetic programming implementation, written for educational purposes but maybe useful

non-incanter statistical tests?

2015-06-01 Thread Lee Spector
Does anyone know of a simple/minimal Clojure library, or just a chunk of Clojure source code that I could cut/paste, that implements basic statistical tests like t-tests and chi-squared tests? I don't want to use incanter but I'd also rather not write this stuff from scratch. Thanks, -Lee P

Re: non-incanter statistical tests?

2015-06-01 Thread Lee Spector
Thanks so much Marshall. Adding "-Djava.awt.headless=true" to my :jvm-opts does indeed fix the "additional java process" problem, so that's helpful if I don't find an alternative to incanter. The R options are interesting but probably not a good solution in my case; I'll be calling these tests

Re: non-incanter statistical tests?

2015-06-02 Thread Lee Spector
Thanks Mike, This looks very much like what I want, in principle, although in practice I'm interested in functions like t-test and chisq-test, which haven't yet made it into core.matrix.stats as far as I can see. FWIW I'd be wary about just copying those things from Incanter, at least because

run Clojurescript via %magic in an iPython notebook?

2015-07-22 Thread Lee Spector
It is apparently possible to run javascript via "magic" commands in iPython notebooks (https://ipython.org/ipython-doc/3/interactive/magics.html). I assume that this would make it possible also to use Clojurescript, but I don't know what would be involved. I have a fair bit of Clojure experienc

Re: map output to string

2014-07-08 Thread Lee Spector
Sometimes you have to manually stamp out laziness, for this among other reasons. In some cases I apply the list function to do this: => (str (map inc (range 10))) "clojure.lang.LazySeq@c5d38b66" => (str (apply list (map inc (range 10 "(1 2 3 4 5 6 7 8 9 10)" -Lee > On 8 July 2014 09:49,

Re: map output to string

2014-07-08 Thread Lee Spector
t; > > > > -- > 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

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 8:48 PM, Stephen Feyrer wrote: > Hi, > > I tried to create the function below in a Lighttable instarepl. In lieu of > any better idea for formatting, the < > statements below indicate instarepl > output. > > (defn avged ([x] > ((def sumed (reduce + x)) < 10 > > (def coun

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 9:31 PM, Lee Spector wrote: > You could patch (not recommended!) this by adding "do" to the beginning of > that list: Or -- I now see, instead of adding the "do" you could just remove the outermost parentheses after the parameter list. But as Sa

Re: [ANN] Gorilla REPL 0.3.3 - inline docs, CIDER compatibility

2014-09-01 Thread Lee Spector
On Sep 1, 2014, at 7:15 AM, Beau Fabry wrote: > Started looking into Gorilla for use at work today. Even prior to this > release I was incredibly impressed. Amazing work everyone involved. > inc The new docs feature is a thing of beauty. -Lee -- You received this message because you ar

Re: Interop nightmare

2014-09-08 Thread Lee Spector
On Sep 8, 2014, at 4:48 PM, Michael Klishin wrote: > Sounds more like "Just enough Java for Clojure". Which I think would have > too small an audience to be worth the effort. I'd buy it for sure. I bet that some of my students would too. -Lee -- You received this message because you are subs

Re: Interop nightmare

2014-09-08 Thread Lee Spector
On Sep 8, 2014, at 9:09 PM, Alan Busby wrote: > On Tue, Sep 9, 2014 at 3:09 AM, Sean Corfield wrote: > > I find that it is quite difficult to use clojure unless one knows Java, > > which I believe to be a barrier to new comers. > > I'm surprised every time I hear this. You can write a lot of

Re: Schrodinger's cat in clojure?

2014-09-13 Thread Lee Spector
A man walks into a bar and says "I used lazy evaluation and things were confusing." Bartender says "You might have mixed it with I/O, but then again maybe you're getting tripped up by other some other not-purely-functional aspect of your program or the JVM, like GC or thread transitions." Ok

Re: Use Require and Import

2014-09-19 Thread Lee Spector
> On Sep 19, 2014, at 11:26 AM, John Gabriele wrote: > > Don't use `use`. :) Since the OP is new here I'll point out that that ":)" is probably a nod to the fact that there's a long history of controversy on the utility/evils of "use". Some (like me) think there are programming contexts in w

Re: Use Require and Import

2014-09-21 Thread Lee Spector
On Sep 21, 2014, at 5:11 AM, Robert Tweed wrote: > In short: use 'use' in the repl or any time you're generally feeling lazy. > Don't use it in non-throwaway code. > > Use automatically refers everything in a namespace. This is handy if you > don't want to type out the names, but it creates tw

Re: Use Require and Import

2014-09-21 Thread Lee Spector
> On Sep 21, 2014, at 12:31 PM, Robert Tweed > wrote: > The whole (ns) block is just boilerplate that you ignore until you need to > refer back to look something up, which is the only time it makes any > difference. You can't ignore the boilerplate while you're writing it, which is a pain th

Re: [PSA] Clojars scp disabled until further notice

2014-09-27 Thread Lee Spector
I just want to chime in to note that not everyone who works in Clojure, and for whom Clojars is the obvious (only?) reasonable way to share libraries, is a professional developer. Some of us are, for example, researchers or students in a range of fields for which reading "complex security stuff

Re: [PSA] Clojars scp disabled until further notice

2014-09-27 Thread Lee Spector
Thanks Phil. We'll definitely look into ":sign-releases false" when we try to get this working next week. -Lee On Sep 27, 2014, at 7:52 PM, Phil Hagelberg wrote: > Lee Spector writes: > >> I just want to chime in to note that not everyone who works in >>

Re: [ccw-users] Re: [ANN] New release 0.28.1 of Counterclockwise

2014-10-04 Thread Lee Spector
What would this mean in practice for using the new drag/drop functionality to open Clojure projects, regardless of origin or history? Would some require an additional manual step to behave as proper Leiningen projects? This new functionality has been making life *much* better for me and for my

Re: [ANN] New release 0.28.1 of Counterclockwise

2014-10-04 Thread Lee Spector
jects imported from github wih no eclipse specific files, it will > continue to do the magic. > > Le samedi 4 octobre 2014, Lee Spector a écrit : > > What would this mean in practice for using the new drag/drop functionality to > open Clojure projects, regardless of origin or

Re: ANN: State of Clojure 2014 Survey - please contribute!!

2014-10-09 Thread Lee Spector
FWIW I'm another person using Clojure mostly for academic research. And for computer science education, e.g. I'm currently teaching a Clojure-based AI course. I'd be curious to know how many others of us are out there. And BTW I think that attention to users in these categories could help to gr

Re: Schrodinger's cat in clojure?

2014-10-11 Thread Lee Spector
On Oct 11, 2014, at 1:00 PM, Jan-Paul Bultmann wrote: > > Therefor "turning of laziness" makes no real sense. You could say "disable > the laziness of seqs", > but that doesn't really make sense either. It's like disabling the FIFO > nature of a queue or a channel. > If you don't want the pro

Re: Decomplecting Clojure

2015-08-13 Thread Lee Spector
Thanks Sebastian for the thoughtful and helpful document! I like it and have shared it with my group. > On Aug 13, 2015, at 1:51 PM, Sebastian Bensusan wrote: > > > I never thought of laziness! It's a good point. Retroactively I might add it > to the Functional Style section :) You did a n

Re: run Clojurescript via %magic in an iPython notebook?

2015-08-17 Thread Lee Spector
Thanks Peter -- I'll take a look at this stuff. -Lee > On Aug 16, 2015, at 8:21 PM, Peter Denno wrote: > > Hi, > > I'm interested in this too. However, I have virtually no experience with > Javascript. The place to begin the investigation, I think, is with the new, > more general implement

Re: usage of "and"

2015-09-07 Thread Lee Spector
> On Sep 7, 2015, at 7:58 AM, jongwon.choi wrote: > > Typo? > > (and cnt (pos? cnt)) Sometimes this kind of thing is reasonable if cnt might be nil, which would break pos?. So the expression says "cnt isn't nil (or false) and it's positive." -Lee -- You received this message because yo

Re: crazy idea...

2015-11-28 Thread Lee Spector
; email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@google

Re: [ANN] 2015 State of Clojure Community survey

2015-12-06 Thread Lee Spector
> On Dec 6, 2015, at 2:43 AM, Mars0i wrote: > > As in the past, many survey questions are not appropriately designed for > getting info about uses of Clojure in academic research. I don't think > there's very much use of of Clojure for this purpose, but the survey won't be > able to track it

Re: [ANN] 2015 State of Clojure Community survey

2015-12-06 Thread Lee Spector
On Dec 6, 2015, at 3:00 PM, Alex Miller wrote: > Almost all of the questions are optional - if they don't apply to your > scenario, you should skip the question. FWIW if I recall correctly (it won't let me back in to check the questions now that I finished it) I think that some questions sort

Re: Clojure as first language

2016-02-21 Thread Lee Spector
s.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > <http://groups.google.com/group/clojure?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe fr

Re: Clojure as first language

2016-02-22 Thread Lee Spector
When I taught with DrScheme back in the day it was a very good experience overall, and while I haven't taught with DrRacket I understand that the team has continued to do great things, and that this is probably a perfect first environment for many teaching contexts. FWIW in my context the restr

Re: Clojure as first language

2016-02-26 Thread Lee Spector
> For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > <http://groups.google.com/group/clojure?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from

Re: Clojure as first language

2016-03-12 Thread Lee Spector
> On Mar 11, 2016, at 9:43 PM, Paul Gowder wrote: > > 2. The other big beginner barrier I feel is the tooling. In lots of ways, > leiningen is amazing (particularly the automatic grabbing of dependencies), > but the forced project structure is really painful. It feels like a massive > barri

Re: Clojure as first language

2016-03-19 Thread Lee Spector
> On Mar 17, 2016, at 11:10 AM, blake watson wrote: > > On Sat, Mar 12, 2016 at 2:42 PM, Lee Spector wrote: > > > Is "lein new app foo" that complicated? > > If I understand Paul correctly—and am not just imposing my own similar > feelings on him—the

more minimal clojurescript intro/app

2016-03-26 Thread Lee Spector
Hi all, I have a pure Clojure program and I would like to make it run in the browser on client machines. It has no dependencies other than Clojure, it does no Java interop, and it has no GUI. There's no database, no user interaction (except for starting the program), and no networking. It just

Re: more minimal clojurescript intro/app

2016-03-27 Thread Lee Spector
Thanks Alan, Pedro, and Colin! All of those look like good starting points, and I will explore them soon. -Lee > On Sat, Mar 26, 2016 at 8:06 AM, Lee Spector > > wrote: > > Can anybody tell me or point me to a resource that will tell me how to get my > Clojure pr

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Lee Spector
On Feb 5, 2014, at 6:05 PM, Alex Miller wrote: > To override the default tiered compilation, add this to your project.clj: > :jvm-opts ^:replace [] I was under the impression that one can get the same effect by running your program with: lein trampoline with-profile production run [etc] True?

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Lee Spector
On Feb 5, 2014, at 8:50 PM, Bruce Adams wrote: > Modern JVM's pick default heap sizes based on the physical memory in > your machine. With more than 1GB of physical memory, initial heap is > 1/64 and maximum heap is 1/4 of physical memory.[1] > > For OpenJDK and Oracle, this command: >java -X

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-07 Thread Lee Spector
On Feb 5, 2014, at 11:42 PM, Michał Marczyk wrote: > This returns > > (.getTotalPhysicalMemorySize > (java.lang.management.ManagementFactory/getOperatingSystemMXBean)) > > You could use this in your project.clj, perhaps by including > > ~(str "-Xms" (quot (.getTotalPhysicalMemorySize ...) appr

how to use the G1 garbage collector

2014-02-07 Thread Lee Spector
Does anyone know what to put in :jvm-opts in project.clj to use the G1 garbage collector? I see a lot about how G1 works and how to configure it in web search results, but not this little nugget of info. Also, if anyone has any advice about GC for my use case I'd love to hear it. My use case i

Re: how to use the G1 garbage collector

2014-02-07 Thread Lee Spector
On Feb 7, 2014, at 11:35 AM, Gary Trakhman wrote: > I do it like this: > > in my .bashrc > > export JVM_OPTS="-XX:+UseG1GC" > export LEIN_JVM_OPTS="-XX:+UseG1GC" > > > You can verify that it's working by checking jvisualvm's view of the jvm-opts > on the relevant processes. Running it syste

Re: how to use the G1 garbage collector

2014-02-07 Thread Lee Spector
On Feb 7, 2014, at 11:41 AM, Laurent PETIT wrote: > What if you put "-XX:+UseG1GC" in :jvm-opts ? Ah yes -- I should have seen that even though I may not want to take Gary's suggestion of putting it in .bashrc, he had given me the magic string to include in :jvm-opts too! I will give that a tr

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-07 Thread Lee Spector
On Feb 7, 2014, at 11:45 AM, Andy Fingerhut wrote: > You may also use a let form wrapped around your entire defproject if you want > to avoid the duplication of code present in your example. Thanks -- I actually noticed that after I posted. I don't know why, but I never thought of project.clj a

Clojure code for detecting overlap of 3d shapes (specifically tetrahedra)?

2014-02-13 Thread Lee Spector
Can anyone point to Clojure code for detecting when two 3d shapes overlap, when given the [x y z] vertices of the two shapes? The specific case I care about will always involve two regular tetrahedra (each of which is specified by 4 vertices), which may allow for special simplifications or eff

Re: Clojure code for detecting overlap of 3d shapes (specifically tetrahedra)?

2014-02-15 Thread Lee Spector
On Feb 15, 2014, at 11:49 AM, Karsten Schmidt wrote: > Hi Lee, I've already implemented the algorithm described in this paper > and it will be part of my upcoming geometry library. To not keep you > waiting for the release, I've extracted the relevant code and put up > here: > > https://gist.gi

Re: Clojure code for detecting overlap of 3d shapes (specifically tetrahedra)?

2014-02-25 Thread Lee Spector
On Feb 16, 2014, at 5:07 PM, Karsten Schmidt wrote: > Yer welcome & please do let me know how this works out for you! I've > updated the gist[1] to delay more parts of the whole computation and > replace most occurrences of `reduce` with `loop` - altogether leading > to an almost 2x faster result

Re: Clojure code for detecting overlap of 3d shapes (specifically tetrahedra)?

2014-02-25 Thread Lee Spector
On Feb 25, 2014, at 5:21 PM, Karsten Schmidt wrote: > Hah! What a classic mistake (not yours)! The bug fix is a single > letter change in the last call to `check-faces-b`. The reference point > to check against should be the 2nd point in tetra `q`. It currently > uses the 1st point `qa`, whereas

Re: More functional Quil

2014-03-09 Thread Lee Spector
FWIW I'm not crazy about these suggestions because they seem to me to be mostly cosmetic, and actually negative if they end up leading to multiple incompatible modes of operation. The Processing model seems to me to be intrinsically imperative, and it's also well-known by lots of people and eas

Re: How did you learn Clojure?

2014-03-21 Thread Lee Spector
A little thing but I use it in when teaching Clojure to newbies and maybe it'll be useful for others: https://github.com/lspector/clojinc/blob/master/src/clojinc/core.clj -Lee -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Function from a symbolic expression

2014-03-31 Thread Lee Spector
On Mar 31, 2014, at 1:27 PM, A. Webb wrote: > > If you are working with quoted expressions, you'll have to eval in the macro > and take the one-time hit there > > (defmacro functionalise2 > [ex var] > (let [arg (gensym) > body (clojure.walk/postwalk-replace {var arg} ex)] > `(f

Re: Function from a symbolic expression

2014-03-31 Thread Lee Spector
On Mar 31, 2014, at 5:59 PM, François Rey wrote: > Forget that, my code does not work with 'z too, obviously. > Too late, time to go to bed for me But my code *does* work with 'z as long as z is also the variable used in the expression, which is what I assume was intended: (defn functional

Re: alternative syntax for Clojure? Haskell?

2014-04-06 Thread Lee Spector
On Apr 5, 2014, at 8:51 PM, Jason Felice wrote: > I focus on expressivity, specifically because of the write-only phenomenom. > This isn't peculiar to clojure; this happened a lot in the Perl days (so much > so, that that's where I remember "write-only code" being coined). FWIW I think "wri

Re: Light table

2014-04-16 Thread Lee Spector
On Apr 16, 2014, at 10:48 PM, Mikera wrote: > On Thursday, 17 April 2014 03:57:56 UTC+8, Mike Haney wrote: >> The conventional wisdom seems to be that you will end up learning emacs >> eventually if you spend any amount of time doing clojure or lisp, so you >> might as well learn it from the s

Re: lein uberjar much faster as lein run

2014-04-22 Thread Lee Spector
On Apr 22, 2014, at 10:01 AM, Jony Hudson wrote: > I recall reading that `lein run` uses JVM options optimised for startup time, > not performance - as it's intended for use in development, not production. I > can't seem to find where I read that though ... Somebody with actual knowledge of w

Re: Clojure equivalent of special common lisp vars: still looking for that zen place...

2014-05-03 Thread Lee Spector
On May 3, 2014, at 9:45 AM, Dave Tenny wrote: > > The way I'm tempted to do this in clojure is > > (def ^{:dynamic true} *x* (atom 1)) > ... do stuff with @*x* ... > (reset! *x* 2) > ... do stuff with @*x* ... > (binding [*x* (atom 3)] (do stuff with @*x*)) Having also come from Common Lisp a

Re: why is this failing on a list

2014-05-04 Thread Lee Spector
On May 4, 2014, at 10:42 AM, Roelof Wobben wrote: > For 4clojure I have to find the second to last item. > > So I did this: > > (fn secondlast [v] > (get v (-(count v)1))) > > Now it's only failing at this test : (= (__ (list 1 2 3 4 5)) 4) > > Can anyone tell me where I did take the wr

stack backtraces for exceptions in agents?

2014-06-02 Thread Lee Spector
In my single-threaded code, exceptions stop execution and print a stack backtrace. This is less informative than I would like [1], but sometimes it provides crucial clues. My multi-threaded code generally uses agents (just because that's the best way I've found to get something that behaves li

Re: stack backtraces for exceptions in agents?

2014-06-02 Thread Lee Spector
(fn [agnt except] (println except)) -Lee On Jun 2, 2014, at 3:38 PM, Sean Corfield wrote: > The exception object should have a full stack trace in it - how are you > printing your exceptions? > > Sean > > On Jun 2, 2014, at 12:28 PM, Lee Spector wrote: >> In

Re: stack backtraces for exceptions in agents?

2014-06-02 Thread Lee Spector
, 2014, at 3:39 PM, Andy Fingerhut wrote: > Try out (clojure.repl/pst e 1000), where e is the exception you have caught. > > Andy > > > On Mon, Jun 2, 2014 at 12:28 PM, Lee Spector wrote: > > In my single-threaded code, exceptions stop execution and print a stack >

Re: stack backtraces for exceptions in agents?

2014-06-02 Thread Lee Spector
PS I should have said "thanks!". -Lee On Jun 2, 2014, at 3:52 PM, Lee Spector wrote: > > Beautiful. > > In fact, if I specify an :error-handler of: > > (fn [agnt except] (clojure.repl/pst except 1000) (System/exit 0)) > > Then it prints the backt

non-lazy clojure?

2014-06-02 Thread Lee Spector
I've generally liked Clojure's pervasive laziness. It's cute and it sometimes permits lovely, elegant approaches to particular programming problems. And although I've long known that it can get you into trouble in a few unusual cases -- I think I recall seeing a nice blog post on issues related

Re: non-lazy clojure?

2014-06-02 Thread Lee Spector
On Jun 2, 2014, at 4:51 PM, Softaddicts wrote: > mapv > > a bit shorter :) > > Luc P. Thanks Luc. I have indeed migrated to mapv for many cases and I could have for the specific final fix for the example I posted. But there are lots of other "fixes" that I made earlier in the same project,

Re: non-lazy clojure?

2014-06-02 Thread Lee Spector
On Jun 2, 2014, at 4:52 PM, Phillip Lord wrote: > Funny, I posted an article of my Clojure gotcha's today > (http://www.russet.org.uk/blog/2991), and this is one of them. I've also had > very nasty bugs, in addition to the general hassle of wrapping a Java API > which works through side-effec

Re: non-lazy clojure?

2014-06-02 Thread Lee Spector
On Jun 2, 2014, at 4:52 PM, Jozef Wagner wrote: > Reducers [1] provide eager variants of some core seq functions (map, filter, > etc.). Note that they do not cache the result, so they recompute it every > time you use their result. > > [1] http://clojure.org/reducers Thanks Josef. I haven't

Re: non-lazy clojure?

2014-06-02 Thread Lee Spector
Gary: That's compelling indeed, and I will look into it more! Thanks, -Lee PS would a call to vec do the same thing as "into []" here? On Jun 2, 2014, at 7:14 PM, Gary Johnson wrote: > Hey Lee, > > I would second Jozef's suggestion that you look into using the reducers > library when y

Re: non-lazy clojure?

2014-06-04 Thread Lee Spector
> On Jun 2, 2014, at 7:14 PM, Gary Johnson wrote: > >> Hey Lee, >> >> I would second Jozef's suggestion that you look into using the reducers >> library when you need non-lazy sequence operations. [etc] On Jun 2, 2014, at 10:38 PM, Lee Spector wrote:

Re: non-lazy clojure?

2014-06-04 Thread Lee Spector
On Jun 4, 2014, at 12:59 PM, Gary Johnson wrote: > Hey Lee, > > (vec ...) is NOT the same as (into [] ...) in this case. [etc] Thanks Gary -- very clear and helpful. -Lee -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: non-lazy clojure?

2014-06-04 Thread Lee Spector
On Jun 4, 2014, at 1:20 PM, Gary Johnson wrote: > - If I operate on a vector with a sequence of r/map and r/filter operations > and finally with "into []" to get back a vector, then I think that fold will > be called within the call to into, and that parallelism should happen > there... right

Re: non-lazy clojure?

2014-06-04 Thread Lee Spector
On Jun 4, 2014, at 1:29 PM, Timothy Baldridge wrote: > Although your original complaint was about clojure seqs being lazy. It should > be noted that reducers are also lazy down to the point of a fold or reduce, > so I'm not sure what you're really getting there. It wouldn't be hard at all > t

Re: non-lazy clojure?

2014-06-05 Thread Lee Spector
) The one that uses reducers is neater and seems to make my program run faster, although I'm not really sure why. In any event, I'm using reducers now only as an alternative concurrency mechanism and solving my original problems by de-lazification. -Lee On Jun 4, 2014, at 7:21 PM, Lee

Re: non-lazy clojure?

2014-06-05 Thread Lee Spector
Oops -- something was wrong with my benchmarks, and my "improvements on the order of 1/3" was wrong. I still see improvements with r/fold as compared to my agent-based approach, but the difference now appears to be only something like 1/20. -Lee On Jun 5, 2014, at 7:19 PM, L

Re: non-lazy clojure?

2014-06-05 Thread Lee Spector
On Jun 5, 2014, at 8:51 PM, Gary Johnson wrote: > Fair enough. Fortunately, Clojure provides so many different tools to select > from in creating you perfect recipe. ;-) > > I'm glad to hear that reducers ultimately provided you with some benefits > over your previous concurrency approach. >

Re: Advice on managing random number generators across threads

2014-06-06 Thread Lee Spector
I don't know if this will be helpful in your application, or even if it's the best approach for our own work (or if java 1.7 provides a simpler approach?), but FWIW one of my projects deals with the thread-local RNG issue via: https://clojars.org/clj-random -Lee On Jun 6, 2014, at 12:28 PM,

Re: a data conversion question

2014-06-08 Thread Lee Spector
On Jun 8, 2014, at 3:12 PM, boz wrote: > Is there a better way to take this... > > [[:a [1 2]] >[:b [3 4]]] > > and convert it to this... > > [[:a 1] >[:a 2] >[:b 3] >[:b 4]] > > than using a loop like this... > > (defn doit [id v] >

Re: [ANN] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-26 Thread Lee Spector
I apologize for the naivety of this question, but whenever I see libraries/discussions of enhanced mechanisms for exceptions/conditions/errors/restarts/etc in Clojure I wonder if they could provide a couple of features that I dearly miss from Common Lisp, and this contribution makes me wonder

Re: [ANN] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-27 Thread Lee Spector
Thanks so much Chris. I've started watching Hugo Duncan's ritz talk and it is definitely what I need to see. It's funny because I never thought of this as platform or IDE functionality -- although it clearly is -- because in the Common Lisp world that I come from, some version of this is avai

Re: [ANN] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-27 Thread Lee Spector
a lot less overhead than having to install/configure/learn/etc emacs if you just to see locals when an exception occurs. -Lee On Sep 27, 2013, at 10:32 AM, Lee Spector wrote: > > Thanks so much Chris. > > I've started watching Hugo Duncan's ritz talk and it is definite

Re: Teaching Clojure to students (how ?)

2013-10-05 Thread Lee Spector
I teach Clojure, to beginning programmers among others. IMHO you really have to specify your audience(s) before any advice about how best to teach Clojure (or programming in general) will make much sense. FWIW in my context one of the most important things is to get them started in an environm

Re: Teaching Clojure to students (how ?)

2013-10-07 Thread Lee Spector
On Oct 7, 2013, at 9:59 AM, John D. Hume wrote: > I'd suggest that Clojure's "Hello, World!" should happen initially at the > repl, where leiningen definitely simplifies the UX. > >lein repl # from any cwd >(println "...") > > which launches nicely into demonstrating dynamic development

Re: Teaching Clojure to students (how ?)

2013-10-07 Thread Lee Spector
Hi James, I have indeed tried LightTable, and it does indeed seem promising. Really exciting potential. But I've hit enough snags every time I've tried it that I haven't really found it useful (either for teaching or for my own use). I just tried the latest version again, just now, and just fo

Re: Teaching Clojure to students (how ?)

2013-10-08 Thread Lee Spector
On Oct 8, 2013, at 8:47 AM, Jernau wrote: > Hi Phil, It was I (Lee) who posted those reactions, but hi and thanks! > 1. Select the text you want auto-indented and press SHIFT+TAB. Nice. Is this (re)discoverable somehow from the interface? > 2. The documentation tab opens in a new tabset - to

Re: Step by step debugging

2013-11-07 Thread Lee Spector
I'd like to chime in here from a background that involved a lot of Common Lisping back in the day. I have been continually dismayed, as I've moved further from Common Lisp, that debugging facilities that are so basic and ubiquitous and helpful in that world are considered exotic or specialized

Re: Step by step debugging

2013-11-07 Thread Lee Spector
Andy, I do think that if a debugging feature has to be limited to a particular environment then Leiningen would be preferable to any other, since it's so simple to install and use (and maybe most people have it anyway?) that people who use other environments could, without too much trouble, do

Re: Step by step debugging

2013-11-07 Thread Lee Spector
What would I need to do to get it to not only retain locals but also show them to me when I hit an error? -Lee On Nov 7, 2013, at 4:22 PM, Alex Miller wrote: > I believe the locals are actually *not* available because they are > proactively cleared to help GC. > > Setting the *compiler-op

Re: Step by step debugging

2013-11-07 Thread Lee Spector
On Nov 7, 2013, at 5:48 PM, Alex Miller wrote: > When you say "hit an error", I'm assuming you mean "clojure throws an > exception" and not "hit a breakpoint in a debugger" or something else. Yes -- I mean "clojure throws an exception." > > I don't think there is one place where we could gen

Re: How to interrupt execution and open a debugger/REPL?

2013-11-12 Thread Lee Spector
On Nov 12, 2013, at 1:58 AM, juan.facorro wrote: > Hi Alexandru, > > As Andy pointed out there's the emacs+Ritz option which has quite a few > features, but if the main thing you want to do is inspect the locals and the > current stack trace, you could use a macro as the one presented in the b

Re: Step by step debugging

2013-11-12 Thread Lee Spector
Very excited by this. Thanks also to Justin for the pointer. >From my perspective a particularly nice additional would be to provide minimal >instructions on how to get this running for people who don't know (or >necessarily want to have to know) what a dt_socket is. On Nov 12, 2013, at 7:11

Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Lee Spector
On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote: > > Calling emacs "incidental complexity" is like calling the North Pole "a bit > nippy this time of year". :) The thing is, it's actually possible to have the power of emacs without the incidental complexity of currently available emacs versi

Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Lee Spector
On Dec 17, 2013, at 8:24 AM, Tim Visher wrote: > On Tue, Dec 17, 2013 at 8:21 AM, Lee Spector wrote: >> On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote: >>> >>> Calling emacs "incidental complexity" is like calling the North Pole "a bit >>&g

bug in clojure.zip when calling next on empty list node?

2013-12-21 Thread Lee Spector
When I step through a zipper made from a nested list via seq-zip, I get extraneous nils after processing a nested (). Is this somehow expected behavior, or a bug, or am I misunderstanding something fundamental? The problem seems to arise only when an nested empty list is present, not other n

Re: bug in clojure.zip when calling next on empty list node?

2013-12-21 Thread Lee Spector
On Dec 21, 2013, at 11:49 AM, Lee Spector wrote: > > When I step through a zipper made from a nested list via seq-zip, I get > extraneous nils after processing a nested (). > > Is this somehow expected behavior, or a bug, or am I misunderstanding > something fundamental

Re: bug in clojure.zip when calling next on empty list node?

2013-12-22 Thread Lee Spector
On Dec 22, 2013, at 12:02 PM, Micha Niskin wrote: > Also, what about this: > > (loop [z (zip/seq-zip '((nil) 0))] > (if (zip/end? z) > :done > (do (println (zip/node z)) > (recur (zip/next z) > > Which produces: > > ((nil) 0) > (nil) > nil > 0 > :done I think that's ac

Re: bug in clojure.zip when calling next on empty list node?

2013-12-23 Thread Lee Spector
On Dec 23, 2013, at 3:40 AM, Cedric Greevey wrote: > On Sun, Dec 22, 2013 at 12:26 PM, Lee Spector wrote: >> The issue I was rasing is that, when traversing '(() 0) with zip/next, one >> should first visit the root, then (), and then 0. But what actually happens >> i

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-27 Thread Lee Spector
On Dec 27, 2013, at 10:53 PM, Alex Baranosky wrote: > I always hear people say that the errors are bad, but I just don't see it. > The stacktraces say exactly what went wrong and at what line of the source. > To me that's all I can hope for. One can hope to see the values of locals, which for

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-27 Thread Lee Spector
On Dec 27, 2013, at 11:18 PM, guns wrote: > > I personally use the following macro from my user.clj: > > (defmacro dump-locals [] > `(clojure.pprint/pprint > ~(into {} (map (fn [l] [`'~l l]) (reverse (keys &env)) > > It's not the automatic break-on-exception-and-start-local-repl of CL

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread Lee Spector
On Dec 27, 2013, at 11:33 PM, guns wrote: > On Fri 27 Dec 2013 at 11:23:22PM -0500, Lee Spector wrote: >> >> On Dec 27, 2013, at 11:18 PM, guns wrote: >>> >>> (defmacro dump-locals [] ... >>> ` >> When and where do you call this? > > I ca

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread Lee Spector
On Dec 28, 2013, at 11:27 AM, Cedric Greevey wrote: > > It helps to go with the "functional, immutable" flow, in which case if you > get an unwanted exception it should *usually* have bubbled up from some > failing test. Add a dump-locals where suggested by the stack trace and rerun > the fail

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread Lee Spector
On Dec 28, 2013, at 2:56 PM, Cedric Greevey wrote: > Your requirements are unusual. > > That being said, you might want to consider: > > 1. Using a PRNG with recordable seed, and sane concurrency semantics, to > achieve repeatability -- rerun with same seed to get identical replay of > events.

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread Lee Spector
On Dec 28, 2013, at 3:11 PM, Cedric Greevey wrote: > Adding to the above, in the specific context of genetic programming, I'd > suggest dividing the population into N subsets, one per core, and trialling > them in parallel to generate fitness scores; then parallel-mergesort to get a > ranked o

Re: In your opinion, what's the best, and what's the worst aspects of using Clojure?

2013-12-28 Thread Lee Spector
On Dec 28, 2013, at 4:46 PM, Cedric Greevey wrote: > Eh, the above should just parallelize working with a single big population. > It's not partitioned as far as making-the-cut is concerned, nor crossover > (given that each thread adds its M crossover-generated entities by reference > to the w

<    1   2   3   4   5   >