Re: Spy - Clojure / ClojureScript library for stubs, spies and mocks

2018-05-02 Thread Travis Daudelin
This looks great! Great timing, I was just struggling with some unit tests where I need a way to validate if a function was called -- 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

Re: [ANN] Eastwood, the Clojure lint tool, version 0.2.4 released

2017-05-31 Thread Travis Daudelin
Awesome replies everyone, thanks for the advice! Will definitely check these plugins out -- 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 -

Re: [ANN] Eastwood, the Clojure lint tool, version 0.2.4 released

2017-05-23 Thread Travis Daudelin
Hi, thanks for posting this looks great! Is there any overlap in functionality between Eastwood and Kibit ? It's not clear to me which tool I should prefer nor when. -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: what tutorials exist for working at the Repl in Emacs?

2016-12-23 Thread Travis Daudelin
> > modern setup in Emacs > I generally recommend https://github.com/bbatsov/prelude for newcomers to emacs, especially if you are interested in Clojure development. As for the repl, Prelude comes with CIDER out of the box and the docs for that are quite good:

Design pattern question: how to decouple data layer from application layer in Luminus service?

2016-11-18 Thread Travis Daudelin
Hello everyone! I am investigating Clojure and, more specifically, Luminus , for a new service my organization will be building soon. My team and I are really excited by the prospect of trying out something new. There is a lot that I like about Luminus' design, but

Re: Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Travis Daudelin
On Friday, June 10, 2016 at 3:03:38 PM UTC-7, Francis Avila wrote: > > A higher-order function can do what this macro does: > https://gist.github.com/favila/ecdd031e22426b93a78f > Oh nice! It looks like I came up with an almost identical solution: (defn transducing [f] (fn [reducing-fn]

Re: Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Travis Daudelin
Actually, I spoke too soon. It looks like completing takes in a reducing function and wraps it so that it meets the arity expectations of a transducer. While this is still super useful to my needs (thanks again!) I wanted to clarify for posterity that completing does not solve the issue in my

Re: Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Travis Daudelin
On Friday, June 10, 2016 at 11:43:04 AM UTC-7, Bobby Eickhoff wrote: > > But maybe the core function completing is very close to what you're > looking for... > Hmm, looking through its source I'd say it's exactly what I'm looking for. Thank you! -- You received this message because you are

Re: Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Travis Daudelin
> > I think you can do what you want with existing transducers. Won't > map/filter/keep/etc do the trick? > I can't say for sure that it's not possible, but I certainly lack the imagination :). The logic I need to write is quite complicated and I'm finding it's easier to write my own

Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Travis Daudelin
Hi all! I'm current working on a project where I am ingesting events off a stream and processing them. There are many many steps involved in the processing component, so I am choosing to write the steps as a series of transducers (because, hey, they're super cool!). Here's the problem though,

Re: Treating mutable Java objects as values

2014-04-05 Thread Travis Wellman
If it were my project I would simply not modify mutable values. If they're modified outside your own code, then model how they change. -- 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

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Travis Wellman
with a new syntax, but I feel like if one didn't begin a line with a paren, one might begin more lines instead of nesting deeper; I could easily be wrong about that. Travis -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Travis Wellman
On Saturday, April 5, 2014 5:51:10 PM UTC-7, Jason Felice wrote: In the original post: I had been writing elegant but deeply nested Clojure code that was very difficult to read ... I focus on expressivity, specifically because of the write-only phenomenom. This isn't peculiar to

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Travis Wellman
On Saturday, April 5, 2014 3:04:01 PM UTC-7, Gary Trakhman wrote: At least in my case, this process of mental macro/functioncall expansion, or 'abstraction-surfing' as I like to call it, got easier over time. I feel like it's been a general skill to hone for programming in general, and

Re: Parsing Clojure with instaparse: how to handle special forms?

2014-02-07 Thread Travis Moy
_parse_ valid clojure code. _Reading_ clojure code from such a parse tree is and should be an entirely seperate concern, implemented as a pass over the generated parse structure. - Reid On Thursday, February 6, 2014 9:28:08 PM UTC-6, Travis Moy wrote: I'm trying to use instaparse to parse

Re: unconditional append to end

2014-02-07 Thread Travis Moy
You should use a vector, but it's also possible to use concat. For example, (concat '(1 2 3) [4]) will give you (1 2 3 4). This made me curious as to the best way to get a collection into vector, so I played around with it some: user= (def r 10) #'user/r user= (def coll (range 1))

Re: unconditional append to end

2014-02-07 Thread Travis Moy
, puzzler wrote: On Fri, Feb 7, 2014 at 9:08 PM, Travis Moy moyt...@gmail.comjavascript: wrote: Surprisingly it looks like (concat coll '(:a)) is faster than (conj coll-v :a). That's not really what I would expect; does anybody have a good explanation for this? Did I just bork the test somehow

Parsing Clojure with instaparse: how to handle special forms?

2014-02-06 Thread Travis Moy
I'm trying to use instaparse to parse Clojure code so that I can reformat it, but I'm having an issue with how to handle special forms. Should I attempt to parse special forms such as let and defn into their own rules, or should I rely instead on the actual content of the terminal to determine

Re: Effects of diving into Clojure

2014-01-14 Thread Travis Vachon
+1 here. I'm afraid the only solution I've found is to stop writing Ruby. ¯\_(ツ)_/¯ On Tue, Jan 14, 2014 at 2:39 PM, Mark markaddle...@gmail.com wrote: I misread the critical piece of your post :) You are, indeed, a step ahead of me On Tuesday, January 14, 2014 11:30:13 AM UTC-8, g vim

Re: How to handle configuration in Clojure?

2014-01-13 Thread Travis Vachon
Another option is to use leiningen profiles to change the classpath, loading different versions of a (eg) config.clj file in different environments. This lets you `require` the config namespace and refer to config parameters like `config/the-configured-value` Travis On Mon, Jan 13, 2014 at 11:05

[ANN] progressbar: easy progress bars in clojure

2013-08-08 Thread Travis Vachon
\r (0 1 2 3 4 5 6 7 8 9) It is designed to make getting feedback about a long running seq-based computation trivial. More information, and the source, here: http://eng.copious.com/blog/2013/08/05/progressbar/ https://github.com/travis/progressbar Enjoy! Travis -- -- You received this message

Re: Clojure in production

2013-06-13 Thread Travis Vachon
We've used Clojure at Copious (http://copious.com) to build our activity feed (http://www.youtube.com/watch?v=0l7Va3-wXeI) and a number of backend services. We're definitely looking to use it even more in the future: it's the cat's pajamas. On Thu, Jun 13, 2013 at 2:07 PM, Deepak Giridharagopal

Re: user math expression evaluation

2013-05-28 Thread Travis Vachon
Incanter has some stuff that does this: http://data-sorcery.org/2010/05/14/infix-math/ this looks even closer to what you're looking for: https://github.com/tristan/clojure-infix On Tue, May 28, 2013 at 2:19 PM, Brian Craft craft.br...@gmail.com wrote: Are there any existing libs for the

Re: binding funkiness

2013-04-22 Thread Travis Vachon
. This is something I've been bitten by a few times, but the power that lazyness brings ends up being worth it, IMHO. Good luck! Travis On Mon, Apr 22, 2013 at 9:41 PM, Daniel Higginbotham nonrecurs...@gmail.com wrote: I've encountered a situation where the binding function doesn't work as I expect

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
))) - This is all pretty contrived, but it seems to work out in the wild pretty well. YMMV, and I'm still not settled on this myself, but hopefully that helps. Travis On Sun, Apr 14, 2013 at 2:16 PM, Simon Katz nomisk...@gmail.com wrote: Whoops — when I said with an extra [namespace

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
the implementation up into focused modules. You might check out the clojurewerks libraries for some insight from a group that has written quite a few libraries: http://clojurewerkz.org/ Travis On Mon, Apr 15, 2013 at 11:23 AM, Simon Katz nomisk...@gmail.com wrote: I'm considering going this way. I

Re: What's the point of - ?

2013-03-11 Thread Travis Vachon
- can also be used in conjunction with a well designed DSL to construct values in a very readable fashion. clj-time has some great examples of this: http://seancorfield.github.com/clj-time/doc/clj-time.core.html#var-from-now (- 30 minutes from-now)

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-09 Thread Travis Vachon
to convert old :use statements to :refer :all whenever possible. Travis On Sat, Mar 9, 2013 at 6:00 PM, Korny Sietsma ko...@sietsma.com wrote: [reviving a slightly old thread] Note that as of clojure 1.4 you can also do: (:require foo.bar :refer :all) in fact from comments I've seen

functions as return values

2013-02-23 Thread Larry Travis
In Clojure, if I have a function call that asks for return of a function, for example user ((fn [a] (fn [b] (+ (inc a) (* b b 5) I get the function name #user$eval4164$fn__4165$fn__4166 user$eval4164$fn__4165$fn__4166@29770daa But what I would like to get is an expression that defines

Re: functions as return values

2013-02-23 Thread Larry Travis
available. --Larry On 2/23/13 5:50 PM, Michael Klishin wrote: 2013/2/24 Larry Travis tra...@cs.wisc.edu mailto:tra...@cs.wisc.edu Is there some way that I can suppress the evaluation of this expression? ((fn [a] '(fn [b] (+ (inc a) (* b b 5) -- MK On 2/23/13 4:50 PM, Larry

Re: lazy maps in Clojure?

2013-01-21 Thread Larry Travis
? On Mon, Jan 21, 2013 at 7:27 AM, Larry Travis tra...@cs.wisc.edu javascript: wrote: One of the neat things about Clojure (maybe all functional languages) is that functions can be defined either extensionally or intensionally. How can one create

lazy maps in Clojure?

2013-01-20 Thread Larry Travis
One of the neat things about Clojure (maybe all functional languages) is that functions can be defined either extensionally or intensionally. How can one create a Clojure structure that mixes these two types of definition? That is, I would like to define a function f that saves its result the

Re: Maps, keywords, and functions

2012-12-21 Thread travis vachon
Having both options available also allows you to make NullPointerException-averse decisions as appropriate. That is, in this function: (defn foo [a-map] (a-map :foo)) I'm potentially exposed to an NPE if the given map is nil. By rewriting it: (defn foo [a-map] (:foo a-map)) I avoid this

Using functions from Java packages

2012-12-16 Thread Larry Travis
It almost certainly has something to do with my abysmal ignorance about things Java, but I don't understand this difference: (1) user (map Math/sqrt [5 6 16]) Unable to find static field: sqrt in class java.lang.Math [Thrown class java.lang.RuntimeException] (2) user (map #(Math/sqrt

Re: Using functions from Java packages

2012-12-16 Thread Larry Travis
Thank you, gentlemen. Jim and Luc, your answers are both helpful. Luc's answer illustrates why a Java tyro often has problems understanding Clojure. Somebody like me who is trying to master Clojure, having come to it via a language path that doesn't include Java, needs a prerequisite crash

What is this function?

2012-10-09 Thread Larry Travis
As participants in this googlegroup have often observed, an excellent way to learn Clojure is to study the source definitions of its API functions. This advice works better for learners who know Java, which I don't. I sometimes think that, if I were to teach a Clojure Programming course, I

Re: What is this function?

2012-10-09 Thread Larry Travis
Mark, Andy, Tassilo: Very helpful, gentlemen. You are kind and skillful tutors. Thank you much. --Larry -- 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

Re: What is this function?

2012-10-09 Thread Larry Travis
Pursuing the thinking behind my original comment, I challenged myself to see how many ways I could write a function equivalent to list* without using _spread_ (assuming I had the full Clojure API available to me -- which, of course, the author of list* did not have). Here are four ways:

Meaning of =

2012-10-02 Thread Larry Travis
What is the rationale for this? user (= [1 2 3 4] '(1 2 3 4)) true I was quite surprised when this turned out to be the cause of a bug in a function I am constructing. Vectors and lists differ so substantially in their implementation and in their behavior that a vector and a list should

Re: General subsequence function

2012-06-27 Thread Larry Travis
Something like this will give you what you want: (defn subseqx [s start end] (cond (instance? clojure.lang.IPersistentVector s) (subvec s start end) (instance? java.lang.String s) (subs s start end) :else (let [slice

Re: How do I set jvm options for a lein repl

2012-05-21 Thread Larry Travis
I should be switching over to Leiningen 2 shortly in any case, but I am curious. How does one set JVM_OPTS as an environment variable? --Larry On 5/21/12 11:42 AM, Phil Hagelberg wrote: On Mon, May 21, 2012 at 5:28 AM, Raju Bitterrajubit...@googlemail.com wrote: How do I set jvm options

Re: How do I set jvm options for a lein repl

2012-05-21 Thread Larry Travis
It took me a while to figure out how to put multiple entries into an environment variable (that is, settings for both min and max heap sizes, to wit, export JVM_OPTS=\ -Xms4G\ -Xmx4G) but, once I did, Phil's and Luc's suggestions have worked well and things have gone swimmingly. They work for

How do I set jvm options for a lein repl

2012-05-20 Thread Larry Travis
How do I set jvm options for a /lein repl/ initiated independently of a project? In particular, I want the heap expansion that results from doing M-x clojure-jack-in in an emacs /project.clj/ buffer with :jvm-opts [ -Xms4G -Xmx4G] in its defproject form. --Larry -- You received this

Re: Best Clojure Learning Resource for Lisper

2012-05-08 Thread Larry Travis
Sean and Lee: In general, I have considered the difference between Aquamacs and GNU Emacs to be that the former prioritizes computer-user interaction via mouse, command-bars and menus (which requires a lot of hand movement between keyboard and mouse, but enables the user to dispense with

Re: Best Clojure Learning Resource for Lisper

2012-05-07 Thread Larry Travis
Lee's comments ring true for me so let me extend them. Before I discovered Clojure, my experience as a programmer had been mainly in the area of artificial-intelligence experimental programming. I was once a reasonably proficient Lisp programmer, but pre-CL and pre-CLOS, that is, mainly

Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Larry Travis
A command like user (doc hash-map) in the slime-repl created by clojure-jack-in results in Unable to resolve symbol: doc in this context [Thrown class java.lang.RuntimeException] Can this be fixed or do I have to do my doc requests someplace else? --Larry -- You received this message

Re: Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Larry Travis
Thank you, Roberto. Works like a charm. --Larry On 5/4/12 2:32 PM, Roberto Mannai wrote: You should use it: user (use 'clojure.repl) nil user (doc doc) ... On Fri, May 4, 2012 at 9:27 PM, Larry Travis tra...@cs.wisc.edu mailto:tra...@cs.wisc.edu wrote: A command like user (doc

Re: Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Larry Travis
Roberto: This indeed looks like it will be useful. Thanks. Your require-all-snippet.clj script loaded OK except for: Attempting to require clojure.parallel : couldn't require clojure.parallel Exception #RuntimeException java.lang.RuntimeException: java.lang.ClassNotFoundException:

Re: Why doesn't doc work in clojure-jack-in slime-repl?

2012-05-04 Thread Larry Travis
Phil: Thanks. I obviously need to start doing my Clojure programming with a Slime cheatsheet in front of me! --Larry On 5/4/12 4:00 PM, Phil Hagelberg wrote: Another way to do it is just use C-c C-d C-d for docs lookup. -Phil -- You received this message because you are subscribed to

Re: Leiningen-noobie question

2012-05-02 Thread Larry Travis
Phil: I now can't get the behavior to reproduce either. I have no idea what kind of dumb mistake I was making in the first place, and I'm very sorry to have wasted your time. (For what it's worth, both dependency-vector versions work in my reproduction attempts -- but you probably already

ClassCastException clojure.lang.Var$Unbound Help

2012-04-30 Thread Travis Smith
this in future. Just guessing and tweaking has gotten me so far, but that's not sustainable. Thanks! -Travis -- 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

Re: ClassCastException clojure.lang.Var$Unbound Help

2012-04-30 Thread Travis Smith
, Stuart Campbell wrote: Hi Travis, (def get-id (session/get :uid)) (defn set-user! [user] (session/put! :uid {:_id user})) Only set-user! is a function here. The value of get-id is evaluated at compile-time. I don't know about the implementation of noir.session/get

Re: Leiningen-noobie question

2012-04-30 Thread Larry Travis
Phil, Neale, Sean: You guys are all way ahead of me as to why I am getting the results I am getting, but it is only Neale's advice that works. That is [prjctOne/prjctOne 1.0.0-SNAPSHOT] works, but [prjctOne 1.0.0-SNAPSHOT] does not. --Larry On 4/30/12 11:14 AM, Phil Hagelberg wrote:

Leiningen-noobie question

2012-04-28 Thread Larry Travis
I have installed Leiningen not so much to manage projects but to enable use of /clojure-jack-in/ as a means of getting Swank and Slime to work. And they do work for me. But now I have a question that I can't find an answer for in any Leiningen documentation I know about. I have a largish,

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
Sean, Your advice makes good sense, but I can't make it work. Per that advice, I paste some of my function definitions into the core.clj file of the project prjctOne and proceed thusly: larrytravis$ lein install Copying 1 file to /Users/larrytravis/prjctOne/lib No namespaces to :aot compile

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
Sean: Your suggestion doesn't work. The Slime REPL comes up fine when I use the dependency vector you suggest (some of the vectors I have tried prevent the Swank server from starting), but the REPL doesn't know anything about the functions defined in prjctOne or about the name-space in which

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
://sw1nn.com/ } On Sun, Apr 29, 2012 at 12:42 AM, Larry Travis tra...@cs.wisc.edu mailto:tra...@cs.wisc.edu wrote: Sean: Your suggestion doesn't work. The Slime REPL comes up fine when I use the dependency vector you suggest (some of the vectors I have tried prevent the Swank

Re: What's the efficient functional way to computing the average of a sequence of numbers?

2012-03-30 Thread Larry Travis
I too think this is interesting because because it serves to illustrate some important general aspects of Clojure with a very simple problem. I wrote four Clojure programs contrasting different ways of solving the problem, and then timed the application of each ten times to a million-item

How can I make this kind of error message more useful?

2012-01-03 Thread Larry Travis
I have been solving Clojure problems now for many months and can no longer exactly be considered a Clojure NOOB, but I still have an awful lot to learn about Clojure. One thing that has caused difficulties from the beginning is that I don't know Java and don't know how to exploit the Java

Re: How can I make this kind of error message more useful?

2012-01-03 Thread Larry Travis
David and Meikel: Thanks for your responses, but it appears to me that what you say applies only to error messages referring to evaluation of defn expressions. Constructing my function definitions in a file separate from the REPL and then recompiling the entire file with a load-file whenever

Re: can't set up Clojure 1.2.1

2011-07-16 Thread Larry Travis
Thanks, Sergey. The problem was indeed a classpath problem. The part of my ignorance about Java that seems to cause me the most trouble is my ignorance about Java classpaths. I think some Clojurians underestimate the difficulties involved in learning Clojure without knowing Java first. I

Re: can't set up Clojure 1.2.1

2011-07-16 Thread Larry Travis
Phil: You ask whether, if I had found it, the following web page would have helped: http://dev.clojure.org/display/doc/Getting+Started+with+Emacs The answer: Definitely yes. The page advises me to use for bringing up a Clojure REPL java -cp path/to/clojure.jar clojure.main whereas the page

can't set up Clojure 1.2.1

2011-07-14 Thread Larry Travis
I need to upgrade from the older version of Clojure I have been using so I downloaded Version 1.2.1 and followed these instructions from http://clojure.org/getting_started: In the directory in which you expanded clojure.zip, run: java -cp clojure.jar clojure.main This will bring up a simple

Re: can't set up Clojure 1.2.1

2011-07-14 Thread Larry Travis
Jonathan: Thanks. When the instructions said the directory in which you expanded clojure.zip I took that to mean the directory I was in when I expanded clojure.zip, not the directory that was created to hold the zip-file contents. --Larry On 7/14/11 10:05 PM, Jonathan Cardoso wrote:

possible bug in cl-format (rounding floating-point number)

2011-06-02 Thread Travis Treseder
. Incidentally, I love using clojure.pprint. It's powerful, and after diving into the CLM spec I have new appreciation for the daunting task it must be to test it. -Travis -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: A newbie's summary - what worked, what didn't

2011-03-28 Thread Larry Travis
Kasim: I just discovered ClojureW, and it looks promising. I will report my reaction after I get time to thoroughly test it for the kinds of things I am doing. In the meantime, a request: When you work 'on a Just Works emacs setup' for Mac Os X consider whether you can create such a setup

Re: Clojure load-file command (+ Aquamacs, Bluefish)

2011-03-14 Thread Larry Travis
Ken: There are a lot of things to like about Aquamacs, and its creator David Reitter deserves high praise as of course do the Emacs creators on whose shoulders he stands. The problem we have raised here is, for the present at least, the only complaint I have about Aquamacs. And there is

Question about the Clojure load-file command

2011-03-12 Thread Larry Travis
that the changed name is an unresolvable symbol? Thanks for any advice any of you might have. I hope the question isn't impossibly dumb. --Larry Travis -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Question about the Clojure load-file command

2011-03-12 Thread Larry Travis
Ken: The cause of my difficulty indeed was a corrupted file. I was looking for it in a completely different direction, and I clearly don't know how to correctly parse Java error messages! Thank you very much for sharing your cleverness and your expertise. --Larry On 3/12/11 7:39 PM, Ken

Re: Why won't leiningen install for me?

2011-01-25 Thread Larry Travis
and Emacs, but I am having a lot of problems getting clojure to run conveniently in that environment. Thanks for your help. --Larry Travis -- 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

Re: Why won't leiningen install for me? (NOW IT DOES!)

2011-01-25 Thread Larry Travis
You guys are great! As my dad used to say when he had been greatly helped: Each of you is a scholar and a gentleman. I admire your expertise. You each had knowledgeable and quite helpful suggestions. I ended up using Alex's ideas for getting the Leiningen installation process to avoid

Why won't leiningen install for me?

2011-01-22 Thread Larry Travis
what to do with it if I could! I am a Java tyro (who knows some other lisps reasonably well) trying to use clojure under Mac Os X and Emacs, but I am having a lot of problems getting clojure to run conveniently in that environment. Thanks for your help. --Larry Travis -- You received

Re: Question about sorted-sets

2011-01-12 Thread Travis Treseder
... Thanks, -Travis -- 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: ANN: lein-cdt 1.0.0 - a leiningen plugin for the Clojure Debugging Toolkit

2011-01-12 Thread Travis Vachon
Unfortunately I haven't used cake at all, sorry! Travis On Tue, Jan 11, 2011 at 12:15 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi,  Thanks Travis. This is something I have wanted for  a long time .. Have you tried using it with cake?  would it work with Cake? Sunil. On Mon

Re: Question about sorted-sets

2011-01-11 Thread Travis Treseder
its insertion. In the example above, sr2 is never even checked against sr1, the one SearchResult that is indeed equal to s2. Maybe I'm implementing (overriding, as the case may be) the wrong interfaces to get this working correctly. -Travis -- You received this message because you

Re: Question about sorted-sets

2011-01-11 Thread Travis Treseder
. You should also try using a TreeSet and see if you get the same results as with sorted-set. I will. Thank you for the suggestions. -Travis -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Question about sorted-sets

2011-01-11 Thread Travis Treseder
(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. I'll fix that and cross my fingers. Thanks, -Travis -- 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

ANN: lein-cdt 1.0.0 - a leiningen plugin for the Clojure Debugging Toolkit

2011-01-10 Thread Travis Vachon
and provide feedback on this tool: https://github.com/travis/lein-cdt http://clojars.org/lein-cdt This release includes: lein cdt - a leiningen task to start a CDT REPL that will automatically connect to a running debug JVM lein cdt-emacs - a leiningen task that will download necessary binary

Question about sorted-sets

2011-01-10 Thread Travis Treseder
what, exactly, is being compared, and it looks like in (conj ss sr1 sr3 sr4 sr2), sr2 is never actually compared to sr1, so sr2 gets added to the set. What am I missing? Any help would be greatly appreciated. -Travis p.s. Yes, the hashCode function isn't the best, but from what I could read

Re: Two convenience methods

2010-07-22 Thread Travis Hoffman
*sigh* ... it was a typo. Good catch! On Jul 21, 10:16 pm, B Smith-Mannschott bsmith.o...@gmail.com wrote: On Wed, Jul 21, 2010 at 23:45, Travis Hoffmantravis.a.hoff...@gmail.com wrote: ... The second function is suggested as an addition to clojure.set. The disjoint? function

Re: Two convenience methods

2010-07-22 Thread Travis Hoffman
direct and to the point. Thanks for the link too! Cheers, -Travis On Jul 21, 6:14 pm, Frederick Polgardy f...@polgardy.com wrote: Oops, you already said that, my bad. :) -- Science answers questions; philosophy questions answers. On Jul 21, 2010, at 8:13 PM, Frederick Polgardy wrote

Re: Complex type in clojure

2010-07-21 Thread Travis Hoffman
I'm still working on it. I've been waiting for the 1.2 release to branch, and also for the other work on the basic types to settle down. Also, I need a little free time. I'll try to get back to it this week. -Travis On Jul 20, 11:09 am, Mike Benfield mike.benfi...@gmail.com wrote: The lack

Re: Complex type in clojure

2010-07-21 Thread Travis Hoffman
I'm still working on it. I was waiting for 1.2 to branch, and to for some other changes to the basic types to happen. Really, I just need a little free time and a kick-in-the-pants! I'll try to get it done this week. -Travis On Jul 20, 11:09 am, Mike Benfield mike.benfi...@gmail.com wrote

Two convenience methods

2010-07-21 Thread Travis Hoffman
? {:added 1.3 :tag Boolean} [set1 set2] (if (= (count set1) (count set2)) (recur set2 set1) (not-any? (fn [item] (contains? item set1)) set2))) Feel free to use these, or, how best should I submit these? Cheers, Travis -- You received this message because you are subscribed to the Google

Confusing compiler error in defrecord and deftype.

2010-07-20 Thread Travis Hoffman
))) (deftype TestType [afield bfield cfield] TestProtocol (printa [_] (println afield)) (printb [_] (println bfield)) (printc [_] (println cfield))) I haven't found, on Assembla, to submit a ticket, otherwise I would have done so. :-) Cheers, Travis -- You received this message because

Re: SAFETY CRITICAL SOFTWARE

2010-07-12 Thread Travis Hoffman
to lose many of the dynamic typing features that make it what it is. Basically, there's no way for Clojure to be Safety Critical. Sorry! -Travis On Jul 11, 8:59 pm, lprefonta...@softaddicts.ca wrote: Hmm.. I would give it a try for a critical app. We have sever apps in Clojure running for months

Re: Name change proposal for extend-protocol

2010-06-23 Thread Travis Hoffman
Thanks for the clarification Stuart! I think I see how to think about protocols ... and not as an interface, in the java sense. I think it makes sense to me now. Love your book, btw! -Travis On Jun 21, 12:31 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Travis, The choice

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-23 Thread Larry Travis
Thanks again. I have to be away from home and my iMac for the next ten days so it will be some time before I can work through your suggestions, but I will certainly give them a try. I'll let you know what kind of success I have. I very much appreciate your help. --Larry Travis Joost wrote

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-22 Thread Larry Travis
exploration. --Larry Travis -- 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

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-22 Thread Larry Travis
if I can. --Larry Travis -- 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

Name change proposal for extend-protocol

2010-06-21 Thread Travis Hoffman
. Cheers, Travis -- 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 email

Re: Complex type in clojure

2010-06-16 Thread Travis Hoffman
this be a localizable field. Please see: http://en.wikipedia.org/wiki/Imaginary_unit#Alternative_notations -Travis On Jun 15, 4:22 pm, James Reeves jree...@weavejester.com wrote: On 15 June 2010 23:26, Carson c.sci.b...@gmail.com wrote: Sorry I may have missed the reason for this earlier:  What's the reason

Re: Complex type in clojure

2010-06-08 Thread Travis Hoffman
more well-reasoned and developed argument for the change when I do! :-) -Travis On Jun 8, 6:33 am, Steven Devijver steven.devij...@gmail.com wrote: On 8 jun, 05:47, Daniel doubleagen...@gmail.com wrote: These notation arguments are compelling. I'm not convinced. The notation would only work

Re: Complex type in clojure

2010-06-08 Thread Travis Hoffman
for the skepticism and the question! -Travis On Jun 8, 11:03 am, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: On Tue, 8 Jun 2010 10:27:28 -0700 (PDT) Steven Devijver steven.devij...@gmail.com wrote: On 8 jun, 16:38, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote

Re: Complex type in clojure

2010-06-07 Thread Travis Hoffman
either i/I or j/J 2.) adding an Imaginary type for pure imaginary numbers ... as a performance improvement. Thanks all! -Travis On Jun 7, 10:32 am, Mark Engelberg mark.engelb...@gmail.com wrote: Yes, but in (some versions of) Scheme, (sqrt -1) yields i. Representing complex numbers and just

Re: Complex type in clojure

2010-06-05 Thread Travis Hoffman
and bless an appropriate library? Or, would we do better to try to develop one from scratch? Regards, Travis On Jun 2, 12:29 am, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 2 Jun 2010, at 02:38, Daniel wrote: This touches upon another subject though: Clojure lacks a good math

Re: Complex type in clojure

2010-06-05 Thread Travis Hoffman
Konrad, Thanks, I'll look at that... I should warn that my changes don't quite seem to be working, there's something running amuck in the code yet that I'm still working on debugging, but the core is a bit mystifying. Also, it seems more elegant to me to be able to simply write a complex

Complex type in clojure

2010-06-01 Thread Travis Hoffman
, but if you're curious I think I correctly created a fork of the master branch with my changes. How would I go about submitting a ticket to add the Complex type and to create a patch to submit my proposed changes? Cheers, Travis -- You received this message because you are subscribed to the Google Groups

numbers at the end of generated class name using compile

2010-04-13 Thread Travis
I'm just curious where those numbers come from. For example, if I compile the class bar.clj containing: (ns bar) (defn foo [] nil) I'll get three classes, one of which is: bar$foo__5.class What is that 5 for? Thanks, Travis -- You received this message because you are subscribed

Re: matching symbols in a dictionary

2010-04-13 Thread Travis
You do mean keywords rather than symbols, right? A symbol would be 'hello. A keyword is :hello. The ruby name for the clojure keyword concept is symbol. I used to get the terminology backwards because of that. (assert (= (name :hello) hello)) (assert (= :hello (keyword hello))) On Apr 13, 2:34 

  1   2   >