Re: Order of keys within a map?

2009-08-28 Thread Travis
Is the number 8 just a magic number? Can it be changed with an environment variable or system variable or binding? I would definitely like to. I am particularly annoyed by how the function into changes my array maps into hash maps when they grow. The type of the first argument is an array map, so

in-smaller-lists

2009-09-25 Thread Travis
base work and this is very useful for processing a csv n rows at a time. 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 N

Re: in-smaller-lists

2009-09-29 Thread Travis
lk wrote: > On Friday 25 September 2009 at 08:46 pm, Travis wrote: > > > I'm doing some file streaming with a lazy list and I ran into a > > problem where I had to process a whole chunk at a time, so I wrote > > this function. Just posting to see if I'm reinventing s

Newspeak

2009-10-06 Thread Travis
I'd like to query the Clojure community for opinions on Newspeak. I just listened to this netcast, which I recommend: http://www.se-radio.net/podcast/2009-07/episode-140-newspeak-and-pluggable-types-gilad-bracha And the website: http://newspeaklanguage.org/ Since I found Newspeak before Clojur

Re: Adding meta data to string?

2009-10-06 Thread Travis
I wonder if anyone has tried namespace level metadata hashes rather than the current approach of putting it on the object itself. I would do it this way: tw$ repl Clojure 1.1.0-alpha-SNAPSHOT user=> (ns meta-experiment (:import java.util.WeakHashMap)) java.util.WeakHashMap meta-experiment=> (def

Re: immutable defs?

2009-10-06 Thread Travis
+1 In my relatively novice opinion, unless there is a reason to make functions and vars available to code executing in a *different* namespace, there isn't a lot of reason to def anything at all. On Oct 2, 11:48 am, Jonathan Smith wrote: > I use a let at the top of the file to denote things tha

Re: Mapping OOPS concepts to Clojure? Doable or Wrong thinking?

2009-12-12 Thread Travis
On Dec 12, 9:21 am, Joost wrote: > * Inheritance is overrated. it tends to be abused as a way to share > implementation details more than anything else. All the points I made > about interfaces also apply to inheritance. See also traits, for a way > to really do reuse:http://scg.unibe.ch/researc

Re: globing filenames via clojure

2009-12-12 Thread Travis
On Dec 12, 11:20 am, Scott wrote: > Trying to learn clojure via some simple examples. > > I would like to use a simple glob expression to open a file using read- > line > > How would I write the equivalent of: > > (for [line (read-lines "*.txt")] >     (print line)) > > Where *.txt would match o

Re: Clojure Kata

2010-01-24 Thread Travis
Occasionally things like this remind me of the similarities between parsing character sequences and dealing with unpredictably ordered collections. For character sequences, the regular expression mechanism has been invented. I wonder if any one else has ever wished for the ability to write a regula

Re: Announcement: Vijual Graph Layout Library for Clojure Version 0.1

2010-01-25 Thread Travis
Any plans to add SVG support? Seems it would, if anything, be easier than formatting ascii. You could then open it up and color/move stuff. Any ideas about compatibility with graphviz(.org)? Maybe a .dot file export? I've considered making a .dot builder myself. -- You received this message beca

java.lang.Double vs double; converting to [D

2010-02-03 Thread Travis
rray via first, so I always see a class type while they really are primitives? 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 ar

Re: Clojure for system administration

2010-02-03 Thread Travis
I would imagine opening a clojure repl and loading the leiningen library. http://github.com/technomancy/leiningen/blob/94c675afe6767aa142bfc882298f0f828e476e24/README.md -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

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 a

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

Re: numbers at the end of generated class name using compile

2010-04-13 Thread Travis
On Apr 13, 5:14 pm, Alex Osborne wrote: > Travis writes: > > 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 c

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 wrote: > Are there any existing libs for the evaluation of math expres

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

[ANN] progressbar: easy progress bars in clojure

2013-08-08 Thread Travis Vachon
s animated from [) to [) using \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 --

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, a

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 transduce

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
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 i

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] (

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: 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: http://cider.readthedocs.io/en/la

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: [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 - pl

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 that

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: Parsing Clojure with instaparse: how to handle special forms?

2014-02-07 Thread Travis Moy
orth it's trivial > to produce a grammar which can _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

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
(into [] coll) :a > "Elapsed time: 16224.79319 msecs" > nil > On Friday, February 7, 2014 9:26:05 PM UTC-8, puzzler wrote: > > On Fri, Feb 7, 2014 at 9:08 PM, Travis Moy > > wrote: > >> Surprisingly it looks like (concat coll '(:a)) is faster than (co

alternative syntax for Clojure? Haskell?

2014-04-05 Thread Travis Wellman
When I started learning Haskell after a year or more of Clojure, the syntax was refreshing, and I found myself wishing I could write Clojure with Haskell syntax. Later I left Clojure behind for plain Java because of code maintenance issues. I had been writing elegant but deeply nested Clojure c

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
one of this would be fundamentally changed 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 Gr

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

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: 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

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 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 wrote: >> >> It's been

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: lazy maps in Clojure?

2013-01-21 Thread Larry Travis
Mon, Jan 21, 2013 at 7:27 AM, Larry Travis > 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 a Clojure structure tha

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 # But what I would like to get is an expression that defines this function, for example (fn [b] (+ 6 (* b b))) Is there some way th

Re: functions as return values

2013-02-23 Thread Larry Travis
until values for their open variables become available. --Larry On 2/23/13 5:50 PM, Michael Klishin wrote: 2013/2/24 Larry Travis 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

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

2013-03-09 Thread Travis Vachon
code, and I've made it a policy to convert old :use statements to ":refer :all" whenever possible. Travis On Sat, Mar 9, 2013 at 6:00 PM, Korny Sietsma wrote: > [reviving a slightly old thread] > Note that as of clojure 1.4 you can also do: > (:require foo.bar :refer

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) http://seancorfield.github.com/clj-time/doc/c

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
oks/search passage))) - 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 wrote: > Whoops — when I said "with an extra [n

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
e a lot of sense to break 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 wrote: > I'm consideri

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 wrote: > I've encountered a situation where the binding function doesn't work as I

Complex type in clojure

2010-06-01 Thread Travis Hoffman
d to Clojure, 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 becau

Re: Complex type in clojure

2010-06-05 Thread Travis Hoffman
Hi Konrad, First off, thanks for the advice, steps and link! Secondly, the link to my fork is: git://github.com/travis-a-hoffman/clojure.git I did notice your Complex implementation in clojure-contrib, and I especially appreciated the effort in the generalizations. I'm a total n00b to Cl

Re: Complex type in clojure

2010-06-05 Thread Travis Hoffman
luate 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 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 >

Re: Complex type in clojure

2010-06-07 Thread Travis Hoffman
ion: 1.) using 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 wrote: > Yes, but in (some versions of) Scheme, (sqrt -1) yields i. > > Representing complex numbe

Re: Complex type in clojure

2010-06-08 Thread Travis Hoffman
ich and the other core developers to make this change, and I think I'm going to have a much more well-reasoned and developed argument for the change when I do! :-) -Travis On Jun 8, 6:33 am, Steven Devijver wrote: > On 8 jun, 05:47, Daniel wrote: > > > These notation arguments are

Re: Complex type in clojure

2010-06-08 Thread Travis Hoffman
supports the complex type, just as it is in Java. This seems to be the preferable approach. Thanks for the skepticism and the question! -Travis On Jun 8, 11:03 am, Mike Meyer wrote: > On Tue, 8 Jun 2010 10:27:28 -0700 (PDT) > > Steven Devijver wrote: > > On 8 jun, 16:38, Mike

Re: Complex type in clojure

2010-06-15 Thread Travis Hoffman
ighborhood of 60 hrs into it so far, so it's been a relatively small effort but I've had to touch some rather obtuse code. I'm a n00b with git (but experienced with cvs and svn); I'm still trying to figure out how to push my local git repository changes to the fork I created on

Re: Complex type in clojure

2010-06-16 Thread Travis Hoffman
ld suggest 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 wrote: > On 15 June 2010 23:26, Carson wrote: > > > Sorry I may have missed the reason for this earlier:  What's the > &

How to derive a protocol from another protocol?

2010-06-18 Thread Travis Hoffman
make sense to implement a protocol with "satisfy-protocol" -- as extend-protocol does now...and then to use "extend-protocol" to create a new protocol based upon a simpler protocol. Can anyone describe the correct approach for extending protocols? Thanks! -Travis -- You re

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

2010-06-20 Thread Larry Travis
lime/, I also get an error message but a different one, viz. "Searching for program: No such file or directory, lisp". I hope somebody has an answer for me w.r.t. Aquamacs, but I will be happy if I can get either version of Emacs to work with clojure and slime. Thanks. --Larry T

Name change proposal for "extend-protocol"

2010-06-21 Thread Travis Hoffman
xtend-protocol" method clearer and more consistent with the "satisfies?" method. 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 fro

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

2010-06-22 Thread Larry Travis
figure it out with some 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 f

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

2010-06-22 Thread Larry Travis
s -- adapting them to Aquamacs 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 yo

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 wrote: > Hi Travis, > > The choice of "extend"

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

Re: SAFETY CRITICAL SOFTWARE

2010-07-12 Thread Travis Hoffman
t would have 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

Confusing compiler error in defrecord and deftype.

2010-07-20 Thread Travis Hoffman
rintln bfield)) (printc [_] (println cfield))) (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. :-)

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 wrote: > The lack of

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 wrote: > The la

Two convenience methods

2010-07-21 Thread Travis Hoffman
and is more readable, imho: (defn disjoint? "Is set1 disjoint from set2?" {: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 sho

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 wrote: > On Wed, Jul 21, 2010 at 23:45, Travis Hoffman > wrote: > > ... > > > > > > > The second function is suggested as an addition to clojure.set. The > > "disjoint?&qu

Re: Two convenience methods

2010-07-22 Thread Travis Hoffman
I find the former to be easier, simpler, more direct and to the point. Thanks for the link too! Cheers, -Travis On Jul 21, 6:14 pm, Frederick Polgardy wrote: > Oops, you already said that, my bad. :) > > -- > Science answers questions; philosophy questions answers. > > On Jul 21

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

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

2011-06-02 Thread Travis Treseder
ed to fix the problem, but I didn't test it extensively. It might be a valid solution in any case. 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 m

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 r

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: Wei

Re: can't set up Clojure 1.2.1

2011-07-15 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 wish

Re: can't set up Clojure 1.2.1

2011-07-16 Thread Larry Travis
uter science -- at least, for the very important areas of programming multi-processor systems and of experimental programming (so important, for example, for artificial intelligence research). --Larry On 7/16/11 10:10 AM, Phil Hagelberg wrote: On Fri, Jul 15, 2011 at 11:29 PM, Larry Travi

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 sequ

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, pr

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
n Corfield wrote: On Sat, Apr 28, 2012 at 12:21 AM, Larry Travis wrote: 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 f

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
programs to work than on getting my programming environment to work. If you get any more ideas about how I might try to solve my problem, let me know. Thanks. --Larry On 4/28/12 5:07 PM, Sean Corfield wrote: On Sat, Apr 28, 2012 at 2:41 PM, Larry Travis wrote: That is, what would cor

Re: Leiningen-noobie question

2012-04-28 Thread Larry Travis
/twitter.com/#%21/sw1nn>, w: sw1nn.com <http://sw1nn.com/> } On Sun, Apr 29, 2012 at 12:42 AM, Larry Travis <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

ClassCastException clojure.lang.Var$Unbound Help

2012-04-30 Thread Travis Smith
elp me avoid problems like 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@googleg

Re: ClassCastException clojure.lang.Var$Unbound Help

2012-04-30 Thread Travis Smith
UTC-4, 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 > co

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 wro

Re: Leiningen-noobie question

2012-05-02 Thread Larry Travis
robably already knew that they would!) --Larry On 5/1/12 11:22 AM, Phil Hagelberg wrote: On Mon, Apr 30, 2012 at 9:28 PM, Larry Travis wrote: 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.

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 <mailto:tra...@cs.wisc.edu>> wrote: A command

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 #java.lang.ClassNotFoundException: jsr166y.forkjoin.ParallelArray> --Larry On 5/4/1

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 th

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 using

Re: Best Clojure Learning Resource for Lisper

2012-05-07 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 memor

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 thi

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 Bitter wrote: How do I set jvm options for a lein repl initiated

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

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 (dr

Can I examine the state of a Clojure lazy sequence?

2012-07-08 Thread Larry Travis
(1) Is there any way I can extract from a Clojure lazy sequence at some given point in its use those of its members that have so far been realized? For example, can I extract the cache of realized members, turn it into a vector, and then process that vector independently of further use of the l

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 no

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 ar

  1   2   >