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-31 Thread David Jacobs
://github.com/dgrnbrg/spyscope With spyscope, you can write a handful of characters and get the stack frame, form, and its value pretty-printed and logged to a queue for future querying. On Thursday, May 30, 2013 8:28:19 PM UTC-4, David Jacobs wrote: That's true -- that's why I wrote up

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-30 Thread David Jacobs
I'm just catching up on this discussion. I think that, regardless of whether any one coder uses them, debuggers are useful to a large subset of people. Even though Clojure likes us to be immutable, there are often times where we would like to debug the mutable parts of our code with something

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-30 Thread David Jacobs
Two more things: 1) printing is often not a viable option for lazily eval-ed sequences or async processes -- the output gets jumbled! And believe me, when a new Clojure dev sees that for the first time, he/she wants to quit. 2) printing is terrible for elegant clojure code -- thing (comp f g h

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-30 Thread David Jacobs
programs contain this function: (defn debug [x] (pprint x) x) Now I can do this: (comp foo debug bar) Also, with some reader literal magic, I could write something to let me do this: (myfunc foo #dbg bar) On Thu, May 30, 2013 at 6:12 PM, David Jacobs da...@wit.io

Re: Convincing employer to go for Clojure

2013-03-12 Thread David Jacobs
forward to seeing many of you there, David On Wednesday, January 9, 2013 11:49:42 AM UTC-8, Ben Mabey wrote: On 1/7/13 4:02 PM, David Jacobs wrote: What other tips do you have for convincing an employer that Clojure makes good business sense? (Of course I've already told them about domain

Re: Convincing employer to go for Clojure

2013-01-08 Thread David Jacobs
On Monday, January 7, 2013 3:02:37 PM UTC-8, David Jacobs wrote: Hey guys, As someone who's written Clojure for a couple of years now, I would love to convince my new company to build our platform using Clojure from the start. Clojure is certainly a possibility for our small team, but a few

Re: Convincing employer to go for Clojure

2013-01-08 Thread David Jacobs
With the* team, that is. (Couldn't let that stay uncorrected heh. I hear ya, Colin, re: sleep.) On Tuesday, January 8, 2013 10:35:07 AM UTC-8, David Jacobs wrote: Thanks for all of the feedback and suggestions, everyone. To clear one thing up, I'm working at an early-stage SF startup, so

Convincing employer to go for Clojure

2013-01-07 Thread David Jacobs
Hey guys, As someone who's written Clojure for a couple of years now, I would love to convince my new company to build our platform using Clojure from the start. Clojure is certainly a possibility for our small team, but a few questions will have to be answered before I can convince everyone

Re: Intern a var from outside namespace

2012-10-17 Thread David Jacobs
I can see the potential problems with this pattern, but it also seems like a nice way to metaprogram things like controllers or models in a web app. (In non-web Clojure dev, I haven't ever run into this issue.) Will have to think about this some more... On Friday, October 12, 2012 at 11:33 AM,

Intern a var from outside namespace

2012-10-11 Thread David Jacobs
I would like to create function names programmatically. So far, I have code that works: (defn create [endpoints] (doseq [{:keys [action method url]} endpoints] (let [endpoint-fn (if (re-matches #.*/:id(/.*)? url) (fn [id session] (method

Re: Intern a var from outside namespace

2012-10-11 Thread David Jacobs
. On Thursday, October 11, 2012 at 9:03 PM, David Jacobs wrote: I would like to create function names programmatically. So far, I have code that works: (defn create [endpoints] (doseq [{:keys [action method url]} endpoints] (let [endpoint-fn (if (re-matches #.*/:id(/.*)? url

Re: Intern a var from outside namespace

2012-10-11 Thread David Jacobs
:18 PM, Alan Malloy wrote: On Thursday, October 11, 2012 9:03:38 PM UTC-7, David Jacobs wrote: I would like to create function names programmatically. So far, I have code that works: ... Where am I going wrong? David Sentence one. Don't do it that way: namespaces

Re: Lazily extract lines from large file

2012-08-17 Thread David Jacobs
Okay that's great. Thanks, you guys. Was read-lines only holding onto the head of the line seq because I bound it in the let statement? On Fri, Aug 17, 2012 at 11:09 AM, Ben Smith-Mannschott bsmith.o...@gmail.com wrote: On Thu, Aug 16, 2012 at 11:47 PM, David Jacobs da...@wit.io wrote: I'm

Lazily extract lines from large file

2012-08-16 Thread David Jacobs
I'm trying to grab 5 lines by their line numbers from a large ( 1GB) file with Clojure. So far I've got: (defn multi-nth [values indices] (map (partial nth values) indices)) (defn read-lines [file indices] (with-open [rdr (clojure.java.io/reader file)] (let [lines (line-seq rdr)]

Best practices for named arguments

2012-06-15 Thread David Jacobs
TL;DR: I want to know best practices for designing functions with multiple optional arguments. Okay, so I'm working to build machine learning algorithms in Clojure, and they tend to need many arguments. Being a long-time Ruby dev, I like to provide sensible defaults for almost all potential

Re: Best practices for named arguments

2012-06-15 Thread David Jacobs
I'm not sure you read the whole question. I want to know how to delegate optional arguments to other functions with the same method signatures. On Friday, June 15, 2012 12:04:00 AM UTC-7, Vinzent wrote: TL;DR: I want to know best practices for designing functions with multiple optional

Re: Best practices for named arguments

2012-06-15 Thread David Jacobs
Ah I see, I didn't realize I could apply the general-descend algorithm to both atoms and arrays to get a flattened list. Thanks! On Friday, June 15, 2012 12:05:36 AM UTC-7, Meikel Brandmeyer (kotarak) wrote: Hi, you can use destructuring to provide defaults. And you can easily curry in

Re: Best practices for named arguments

2012-06-15 Thread David Jacobs
Very cool, this is exactly what I wanted. Thanks. On Friday, June 15, 2012 7:27:05 AM UTC-7, Gunnar Völkel wrote: Hello David. I have a very similar scenario according to named parameters liker you. Therefore I have written the library clojure.options which can be found here:

Re: Doseq, map-style

2012-06-10 Thread David Jacobs
version of map, I would avoid the macro suggested earlier, and just do (def each (comp dorun map)) or (defn each [f coll] (doseq [x coll] (f x))) -Walter On Sat, Jun 9, 2012 at 5:08 PM, David Jacobs da...@wit.io (mailto:da...@wit.io) wrote: Thanks, guys. I know

Re: Function minimizer a la fminunc

2012-06-10 Thread David Jacobs
...@gmail.comwrote: maybe http://commons.apache.org/math/apidocs/index.html will help? - lk On Jun 10, 2012 7:09 AM, David Jacobs da...@wit.io wrote: Thanks! That section of Incanter must be new, I haven't seen it till now. Will check it out and report back. On Friday, June 8, 2012 at 7:15 AM

Re: Doseq, map-style

2012-06-10 Thread David Jacobs
This is good stuff. I've certainly felt the same way about FP at some points--for me, Clojure really illuminates why people thought OO was such a good thing 15 years ago. Let me know if you write that blog post. On Saturday, June 9, 2012 7:47:47 PM UTC-7, Kurt Harriger wrote: You could

Re: Doseq, map-style

2012-06-10 Thread David Jacobs
of the results. If you call the function just for side-effects, but not the return value, then the semantics of map don't apply. Kind regards Meikel -Ursprüngliche Nachricht- *Von: *David Jacobs da...@wit.io* An: *clojure@googlegroups.com* Gesendet: *Sa, 09 Jun 2012, 23:08:21

Re: Doseq, map-style

2012-06-09 Thread David Jacobs
...@gmail.com) wrote: Combine map with dorun and you get the same effect: (dorun (map println logs)) http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/dorun Allen On Thu, Jun 7, 2012 at 11:32 PM, David Jacobs da...@wit.io (mailto:da...@wit.io) wrote: I

Re: Function minimizer a la fminunc

2012-06-09 Thread David Jacobs
Thanks! That section of Incanter must be new, I haven't seen it till now. Will check it out and report back. On Friday, June 8, 2012 at 7:15 AM, Lars Nilsson wrote: On Fri, Jun 8, 2012 at 12:30 AM, David Jacobs da...@wit.io (mailto:da...@wit.io) wrote: Has anyone written a function

Function minimizer a la fminunc

2012-06-08 Thread David Jacobs
Has anyone written a function minimizer in Clojure (or in Java)? I want something like Octave's fminunc [0], where I can pass in a function and a parameter list and find the parameters that minimize the function. Anyone know of one? [0]

Doseq, map-style

2012-06-08 Thread David Jacobs
I would love to have a version of doseq that works like map (similar to each in other dynamic languages). In other words, instead of (doseq [log logs] (println log)), I would say something like (each println logs). Is there a built-in Clojure method that works like this? -- You received this

Last value from REPL

2012-01-28 Thread David Jacobs
Does the Clojure REPL provide a handle for getting the value returned by the last executed statement? In Ruby's REPL, the underscore gives you the last returned value. In Clojure, I'd love to do something like this: (some-expensive-or-rate-limited-call example.com) (def cache-after-the-fact _)

Re: Shebang support for cljr

2011-04-20 Thread David Jacobs
What's the status on this? One of the reasons I don't use Clojure everyday, much as I like it, is that I want it to integrate seamlessly with Unix for scripting. David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Shebang support for cljr

2011-04-20 Thread David Jacobs
at 1:28 AM, Mike Meyer m...@mired.org wrote: On Wed, 20 Apr 2011 10:16:05 -0700 (PDT) David Jacobs develo...@allthingsprogress.com wrote: What's the status on this? One of the reasons I don't use Clojure everyday, much as I like it, is that I want it to integrate seamlessly with Unix

Re: Shebang support for cljr

2011-04-20 Thread David Jacobs
You also have to remember that relative paths (including file names passed to your script) will be interpreted relative to the Nailgun server, not the user's working directory. That sounds like a major bug that can (and should) easily be corrected. -- You received this message because you

Re: Release.Next Version Number

2011-02-23 Thread David Jacobs
of the language 2.0. Just my $0.02. David Jacobs On Wed, Feb 23, 2011 at 11:18 AM, Lärry ki6...@gmail.com wrote: Gang - I'm still in the playing stage with the language. I'm exploring Clojure and prototyping ideas for future directions. The language is very expressive and its community is quite

Re: Release.Next Version Number

2011-02-23 Thread David Jacobs
Hi Saul, Thanks for the suggestions. I should say that I was only giving you my impression of using Clojure re: it's version number. I'm not saying any of the things I listed are not doable, just that they feel very ad-hoc and not quite ready for a 2.0. I come from the Ruby world, and Ruby isn't

Re: Release.Next Version Number

2011-02-23 Thread David Jacobs
: 2.0, though, so I guess if we want to talk about that, we can take it to another thread. David On Wed, Feb 23, 2011 at 7:01 PM, Chas Emerick cemer...@snowtide.com wrote: On Feb 23, 2011, at 4:06 PM, David Jacobs wrote: - better discovery for existing, well-tested libraries. You can search

Re: ANN: Clojure Toolbox (Early Beta)

2011-02-23 Thread David Jacobs
Looks fantastic, this is exactly what I was thinking about when I said Clojure libraries need more discoverability. Excellent work. David On Wednesday, 23 February 2011 at 10:12 pm, semperos wrote: Thanks for taking the time and effort to put this together. -Daniel -- You received

Re: Boston Clojure Meetup Thursday Jan 13

2011-02-12 Thread David Jacobs
I don't know how I missed this originally. Is there another one planned? -- 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

Re: Lots of newbie clojure questions

2010-12-06 Thread David Jacobs
1. Isn't the world actually imperative? And mutable? If you're a determinist, then no. Life is a function (albeit a multivariable function), just like sine. 2. 'Side-effects' are treated almost as a bad word by most functional programming advocates. And yet, aren't ALL programs executed

Find all ties in a sorted list

2010-11-10 Thread David Jacobs
I have a sorted list, and I'd like to derive from that a list containing all ties in the original. That is, if I have (1 2 3 4 4 5 5 5 5 5 6 9 12 12), I want to get back the sequence (4 4 5 5 5 5 5 12 12). My first thought was to try to filter down the list, but filter takes each element of a

Re: Find all ties in a sorted list

2010-11-10 Thread David Jacobs
Wow, thanks for the quick replies, guys :) I can't decide which one I like best. On Nov 10, 3:40 pm, Ken Wesson kwess...@gmail.com wrote: And (let [x (map #(if (= %1 %2) [%1]) s (rest s))]   (mapcat #(if (nil? %1) %2 %1) x (concat (rest x) [nil]))) does it lazily. :) -- You received this

Re: Find all ties in a sorted list

2010-11-10 Thread David Jacobs
of [element, count] pairs, you could do this: (defn seq-ties [coll] (- coll (partition-by identity) (filter next) (map (juxt first count))) (seq-ties [1 1 1 1 2 3 3 4 5 7 7]) ;==([1 4] [3 2] [7 2]) On Nov 10, 1:27 pm, Juha Arpiainen jarpi...@gmail.com wrote: On Nov 10, 10:28 pm, David

Re: Java Source Indentation

2010-10-20 Thread David Jacobs
, David Jacobs develo...@allthingsprogress.com wrote: I've just started learning Clojure and I'm excited about what I see. The combination of power and sophistication in the language is refreshing, and I've started to dive into the source code to understand it better. One meta-observation

Re: Java Source Indentation

2010-10-15 Thread David Jacobs
, no? On 14 Oct 2010, at 10:47 pm, Santosh Rajan wrote: IMHO if it is not broken, dont fix it. I am sure the original authors are aware and are very much around. Probably they would be the best people to do it anyway. On Fri, Oct 15, 2010 at 7:43 AM, David Jacobs develo

Java Source Indentation

2010-10-14 Thread David Jacobs
I've just started learning Clojure and I'm excited about what I see. The combination of power and sophistication in the language is refreshing, and I've started to dive into the source code to understand it better. One meta-observation has come out of my scouring. The indentation used for the