I use Maven indirectly via Ivy, so I just wanted to request that,
whatever the choice of naming, the artifact and module names should
parallel. The reason for this request is that Ivy can resolve
dependencies in maven by creating URLs from a pattern. For example:
pulls from org/clojure/clojur
Yes, the reason the larger one works is because the parameters to *
just happen to overflow to values that let the result of * not go out
of bounds.
As for doing bounds checking during (int), I think that would be a net
loss. Generally speaking, casting to a primitive is intended to aid
performa
On May 30, 12:58 pm, eyeris wrote:
> The ubiquity of these anonymous functions
> in clojure code is evidence that partial application is just as needed
> in clojure as it is in haskell.
Doesn't that depend entirely on whether or not the anonymous functions
are being used for partial applicatio
On further consideration, having partial so the arity handling in non-
trivial cases is where it trumps an anonymous function.
On May 31, 2:04 am, ataggart wrote:
> On May 30, 12:58 pm, eyeris wrote:
>
> > The ubiquity of these anonymous functions
> > in clojure code is evi
On May 31, 5:20 am, Meikel Brandmeyer wrote:
> Am 31.05.2009 um 11:11 schrieb ataggart:
>
> (partial f a b) is equivalent to #(apply f a b %&). So anonymous
> functions are the more general, more powerful concept.
Ah, beautiful! Somehow I missed the %& form w
Tonight Rich made a comment (related to distributed computing) about
not wanting to include things in the language that should belong in
libraries.
This led me to wonder (only after leaving the meeting), where does
that boundary live? Is clojure.core "language" or "library"? Is it
the java impl
What was the solution?
On Jun 9, 1:03 pm, prhlava wrote:
> > I am playing with GridGainhttp://www.gridgain.comfrom Clojure and I
> > am getting
> > exception related to serialization.
>
> Never mind, I tool a wrong approach at first. Now I have it running,
> apologies for the noise...
>
> Kind r
On Jun 9, 11:07 am, "alfred.morgan.al...@gmail.com"
wrote:
> Thanks for the advice, but at present I'm simply aiming to get the
> very basics of a neural net up and running without having to worry
> about a training algorithm at all. Here's what I have so far (again,
> very basic)
>
> ;; Net0
On Jun 20, 4:59 pm, Rowdy Rednose wrote:
> On a side-note: I actually think it can make sense to do io in
> transactions in Clojure, and I believe (knowing that transactions can
> be replayed) it is possible to use that to e.g. implement a
> transaction log written to disk that could be used to
On Jun 26, 9:12 pm, Four of Seventeen wrote:
> Not that it really matters why it is/was down. The API docs going down
> for any amount of time longer than a minute or so is bad bad news.
...
> By contrast, in over a decade of usinghttp://java.sun.com/javase/6/docs/api/
> and its predecessors I
What do you need that a cron job wouldn't provide?
On Jun 26, 8:43 am, Stuart Halloway wrote:
> I am working on a Clojure project that is becoming more and more
> schedule-oriented. So far I have been using Clojure's native
> concurrency constructs, but I am becoming tempted to use Java's
A set might be better to hold the player-refs, then you can just call
(disj player-refs player-ref) without doing any extra checking.
Also you can access ref values without needing to be in a dosync.
Things being immutable, the value you get from, say, @team-ref won't
change once you have it.
On
I should have been more clear when I said to use (disj ...); I meant
sending that via an alter.
On Jul 5, 6:05 pm, ataggart wrote:
> A set might be better to hold the player-refs, then you can just call
> (disj player-refs player-ref) without doing any extra checking.
>
> Also yo
Phil, it might be worthwhile to look at Ivy (http://ant.apache.org/
ivy). It has real good interop with ant and can easily pull from a
maven repo and read pom files.
On Jul 7, 9:28 pm, Phil Hagelberg wrote:
> I've been noodling on the problem of dependency management for a while
> now. It's def
After having spent the last decade doing server-side java, lots of
infrastructure level code which I enjoy), and going blind on xml, I'd
really like to get more into clojure.
I've been playing with it off and on for about a year now, reading
whatever FP-related material I can get my hands on, but
How about:
(get-in nestedDS [1 "hello" 0])
http://clojure.org/api#toc279
On Jul 20, 1:31 pm, Moses wrote:
> I come primarily from a perl programming background, but am trying
> to learn Clojure.
>
> I'm looking for a clojure equivalent to the following.
>
> Perl:
>
> my $nestedDS = [
I've written up a small set of logging functions to output from
clojure what I'm already doing from my production java code.
Currently it checks for the presence of commons-logging, log4j, and
finally java.util.logging. The clojure code doesn't actually do any
logging itself; instead everything
logged-future -> I find handy for long running threads
> debug -> its nice to be able to log an expression and what
> its evaluated to while leaving it in place (+ (debug (+ 1 2)) 3)
> current-function-name (Stephen C. Gilardi posted) -> optionally
> including t
.
log-capture! [log-name]
Redirects writes of System.out and System.err to the logs
log-uncapture!
Restores the System.out and System.err to their defaults.
with-logs [log-name & body]
Evaluates the body with *out* and *err* redirected to the logs
On Jul 22, 11:53 am, ataggart wrote:
logic as the original statement, but
> > if the logging level is :fine then it will additionally log the
> > intermediate part. I find both forms useful. Unfortunately the naming
> > gives no clue as to the differences between them.
>
> > Regards,
> > Tim
Hmm, I like "spy" since it doesn't mimic a logging level like "debug"
and "trace" do. Making the change now, thanks.
On Jul 23, 11:01 am, Laurent PETIT wrote:
> What about 'spy instead of 'debug ? Or 'trace ?
>
> 2009/7/23 ataggar
Ok the patch file has been languishing on assembla for a few days, so
I've uploaded it to the files section here if anyone wants to use the
latest version.
logging.clj at http://groups.google.com/group/clojure/files
http://groups.google.com/group/clojure/files
On Jul 23, 11:20 am, ata
On Jul 27, 10:06 am, BerlinBrown wrote:
> So far I have found that clojure is about
> 5-10 times as slow as comparable code in Clojure.
I infer you mean clojure execution times are about 5-10 times longer
than in java. It depends on what you're doing, but that sounds
plausible.
Here's are so
I threw this together, how does it measure up?
(defn prime? [x primes]
(not (first (filter #(zero? (rem x %)) primes
(defn next-prime [xs primes]
(lazy-seq
(let [xs (drop-while #(not (prime? % primes)) xs)
prime (first xs)
primes (conj primes prime)]
(cons
The problem is you aren't quoting the forms fed to eval.
This:
(eval (struct foo 1 2))
mean this:
(eval {:bar 1 :baz 2})
And small literal maps are eval'd as a PersistentArrayMap
Now if instead you do:
(eval '(struct foo 1 2))
then eval is eval'ing the form (struct foo 1 2), thus t
On Aug 1, 9:37 am, Garth Sheldon-Coulson wrote:
> Hi there,
>
> I have a program that produces multidimensional LazySeqs, i.e. seqs of seqs
> of seqs of...
>
> I would like to write a function to convert these multidimensional LazySeqs
> to vectors. This is in case a user needs constant lookup
Here's the well-hidden, auto-generated docs for clojure-contrib:
http://richhickey.github.com/clojure-contrib/
On Aug 3, 5:41 pm, James Sofra wrote:
> I think he may mean
> thishttp://code.google.com/p/clojure-contrib/wiki/OverviewOfContrib
> Is it still being updated?
> It says "Updated Jun
On Aug 4, 4:46 pm, Vagif Verdi wrote:
> When reflection warning is on, i get 2 warnings on every my file:
>
> reference to field getClass can't be resolved.
> reference to field getClassLoader can't be resolved.
>
> Is this something i should be worried about ?
Probably not. It appears to be in
In testing out clojure.contrib.logging within a generated servlet, I
noticed that the value of *ns* is always clojure.core, and not the ns
of the code.
I just wanted to make sure I wasn't missing something obvious.
The servlet code:
(ns com.example.servlet
(:require (clojure.contrib [logging
On Aug 5, 9:11 pm, Richard Newman wrote:
> > In testing out clojure.contrib.logging within a generated servlet, I
> > noticed that the value of *ns* is always clojure.core, and not the ns
> > of the code.
>
> I have observed this too (running in SailFin, which is based on
> GlassFish).
>
> >
On Aug 5, 11:24 pm, Richard Newman wrote:
> > Bah! I tried to simplify the example code, and missed conveying the
> > actual problem. Your example code (and sadly, mine) pulls *ns* at
> > runtime, the logging macro doesn't; it writes the value of the *ns* at
> > macro-expansion-time precisely
Anne, please don't threadjack. Now my original subject appears
missing, since you renamed it.
On Aug 6, 1:03 am, Anne Ogborn wrote:
> (use 'clojure.contrib.duck-streams)
> (spit "C:\\test.txt"
> (with-out-str
> (println "foo")
> (println "bar")
> (flush)))
>
> On my XP Tab
Restoring this thread's original subject.
On Aug 6, 10:40 am, ataggart wrote:
> Anne, please don't threadjack. Now my original subject appears
> missing, since you renamed it.
>
> On Aug 6, 1:03 am, Anne Ogborn wrote:
>
>
>
> > (use 'clojure.con
Ok, yes, I will blame my idiocy on sleep deprivation.
In every case the name used by the log is the runtime *ns*, which
really defeats the purpose of naming the specific usages of log. I'm
surprised no one mentioned this (imo wrong) behavior.
I'll get to work on fixing it so it behaves properly.
Ah, very well. I find it useful to print out so I know which code is
doing the logging, since stack inspection is very expensive, and in
the case of clojure, looks like a mess of underscores and dollar
signs. ;)
On Aug 6, 12:31 pm, Richard Newman wrote:
> > In every case the name used by the lo
Restoring subject again
On Aug 6, 12:48 pm, Anniepoo wrote:
> Sorry for the confusion - I read this list on an email feed. Turns out
> replying to a message from there and changing the subject isn't
> sufficient to start a new thread. Apparently it renames the thread.
> (suboptimal).
>
> ori
On Aug 11, 11:55 am, fft1976 wrote:
> I feel that this question is important enough to warrant its own
> thread.
http://groups.google.com/group/clojure/search?group=clojure&q=%22as+fast+as+java%22&qt_g=Search+this+group
>
> If you use Java's arrays and declare all types, should Clojure be as
I'd like to second all of this. The very first time I had to fix
someone else's bug was when the dev used "a.compareTo(b) == -1".
On Sep 9, 1:37 am, B Smith-Mannschott wrote:
> On Tue, Sep 8, 2009 at 23:35, Stephen C. Gilardi wrote:
>
> > On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote:
>
>
Just for my own edification (not being versed in python), what's the
point of knowing that?
On Sep 18, 3:46 am, Kelvin Ward wrote:
> java -cp clojure.jar clojure.main foo.clj
>
> I'm wondering if the code in foo.clj has anyway to know it is being
> executed as a script. In python there's the id
How about something like this:
(filter #(not= % :nomatch) (map #(if (= %1 %2) %1 :nomatch) [1 2 3 4]
[1 3 3 3]))
Or cleaned up for general use:
(defn filter-map
"Returns the results of map, but filtered to contain only those
items whose inputs to f have satisfied pred. pred takes the same ar
s within the compared
> seqs :-(
>
> 2009/10/14 ataggart
>
>
>
>
>
> > How about something like this:
>
> > (filter #(not= % :nomatch) (map #(if (= %1 %2) %1 :nomatch) [1 2 3 4]
> > [1 3 3 3]))
>
> > Or cleaned up for general use:
>
>
I second Tim's comment regarding holding onto calculated values.
That's at best a performance optimization, and likely an unnecessary
one.
Also, by using the product itself as a key simplifies the case where
you try to "add" the same product as multiple line-items (though this
may be what you wan
Also you can substitute #^"[C" with the more legible #^chars.
On Oct 28, 7:27 pm, Alex Osborne wrote:
> Chick Corea wrote:
> > What is wrong with this code? I want to instantiate a Java String
> > from a Java character-array.
> > But I want it to be fast, hence the need to cast per the "warn o
If (Integer/parseInt "5") works, then not all functions need be an
implementation of IFn; or perhaps more precisely, clojure knows when a
call is being made to an IFn vs a static java method. It would be
nice for consistency if whatever makes that work also treated Integer/
parseInt as a function
Good point about type-hinting.
On Nov 2, 11:42 am, Chouser wrote:
> On Mon, Nov 2, 2009 at 3:32 PM, ataggart wrote:
>
> > If (Integer/parseInt "5") works, then not all functions need be an
> > implementation of IFn; or perhaps more precisely, clojure knows when a
(into [] (concat [1 2] [3 4]))
Different tools for different jobs. And Mark makes a great point
about assuming too much from a particular usage.
On Nov 3, 7:56 pm, mbrodersen wrote:
> Currently (into) takes 2 parameters (destination and source):
>
> (into [] [1 2]) => [1 2]
>
> but not more
Just use first and second for both cases.
On Nov 11, 9:52 am, samppi wrote:
> Clojure 1.1.0-alpha-SNAPSHOT
> user=> (conj (first {1 2}) 3)
> [1 2 3]
> user=> (conj {1 2} [2 5])
> {2 5, 1 2}
> user=> (key (first {1 2}))
> 1
> user=> (key [1 2])
> java.lang.ClassCastException: clojure.lang.Persist
The sequence returned from the filter would need to be rescanned to
get the nth element, but the filtering itself should only need to
happen when the "next" element in the sequence is sought.
For cases such as the one you describe, I think it's common to fully
realize the sequence into a vector, e
Getting back to the initial post, this would be the (almost)
equivalent code in java:
public class Test{
static int x = 1;
void bindingX(int val){
x = val;
}
int dummyFn2(){
return x + 1;
}
void dummyFn(){
System.out.println("entering function: "
The c.c.logging library delegates to an underlying implementation,
thus for any configuration help you'll need to check the documentation
of the actual logging system, e.g., log4j.
On Nov 21, 7:21 am, Alex Ott wrote:
> Hello all
>
> I have one question about logging library from contrib? How i
That's not how you create a new struct instance.
http://clojure.org/data_structures#toc19
On Nov 23, 6:29 am, cearl wrote:
> Hi,
> I'm getting a cast exception on trying to create a simple structure
> and wondered if there was something obvious that I'm not doing. The
> transcript below shows
Bear in mind that when going from the "slow" to the "fast", you not
only removed the repeated calls to to-array, but also removed the
overhead of words-with, since the lazy seq returned from the let
doesn't get fully realized.
Try changing your "fast" version to:
(def update-wlist #(let [w (doall
On Nov 25, 11:09 am, Martin DeMello wrote:
> On Thu, Nov 26, 2009 at 12:31 AM, Jonathan Smith
> > To display you would want to use 'into-array' and your 'setListData'
> > function, because you seem to have a homogeneous collection of
> > strings; while to-array makes you an array of objects, into-
On Dec 2, 9:10 am, Konrad Kułakowski (kony)
wrote:
> Recently I need something which works as "inverse of interleave"
>
> I did something like that:
>
> (defn unravel [expr-list]
> (loop [flist () slist () tic-tac 0 olist expr-list]
> (let [item (first olist)]
>
On Dec 2, 10:50 am, Johann Hibschman wrote:
> I don't understand Clojure's space requirements when processing lazy
> sequences. Are there some rules-of-thumb that I could use to better
> predict what will use a lot of space?
>
> I have a 5.5 GB pipe-delimited data file, containing mostly floats
On Dec 2, 10:50 am, Johann Hibschman wrote:
> I don't understand Clojure's space requirements when processing lazy
> sequences. Are there some rules-of-thumb that I could use to better
> predict what will use a lot of space?
>
> I have a 5.5 GB pipe-delimited data file, containing mostly floats
On Dec 2, 7:10 am, Stefan Kamphausen wrote:
> Hi,
>
> while studying the collection types and trying to find out which
> functions work on all collection types (i.e. lists, vectors, maps,
> sets) I was flabbergasted by the following
>
> user> (contains? (list 1 2 3) 3)
> false
>
> OK, the doc of c
On Dec 2, 12:06 pm, ataggart wrote:
> On Dec 2, 7:10 am, Stefan Kamphausen wrote:
>
>
>
>
>
> > Hi,
>
> > while studying the collection types and trying to find out which
> > functions work on all collection types (i.e. lists, vectors, maps,
> &g
On Dec 2, 12:02 pm, Chouser wrote:
> On Wed, Dec 2, 2009 at 2:06 PM, ataggart wrote:
>
> > On Dec 2, 9:10 am, Konrad Kułakowski (kony)
> > wrote:
> >> Recently I need something which works as "inverse of interleave"
>
> > How about this?
>
&g
On Dec 2, 1:08 pm, Stefan Kamphausen wrote:
> Hi,
>
> On Dec 2, 9:06 pm, ataggart wrote:
>
> > > I'd like to understand the (probably well-grounded) reason for that.
> > > As far as I can see PersistentList extends Counted, so the check for
> > >
If by "koan" you mean usage examples, then there are plenty of them
within the clojure source itself, as well as clojure-contrib.
See also: http://rosettacode.org/wiki/Category:Clojure
Leave it to rubyists to turn a simple concept like examples into some
religious indoctrination. I kid!
On Dec
On Dec 2, 1:32 pm, Stefan Kamphausen wrote:
> Hi,
>
> On Dec 2, 10:24 pm, ataggart wrote:
>
> > My guess is that String and array, while not implementing the
> > IAssociative interface, all have the O(1) lookup performance
> > guarantees of associative data stru
On Dec 2, 8:15 pm, lazy1 wrote:
> Hello,
>
> I'm trying to create a "factory" method for Java classes, however I'm
> doing something wrong.
>
> (import '(java.util Dictionary HashMap))
>
> (def *containers* { :dict Dictionary :hash HashMap})
> (defn new-container
> [type]
> (new (*containers
There's take-nth in core, but no drop-nth (which sounds like what you
need), so I wrote it:
(defn drop-nth [n coll]
(lazy-seq
(when-let [s (seq coll)]
(concat (take n s) (drop-nth n (next (drop n s)))
So, in your example:
(vec (drop-nth 2 [2 4 5 8 6 4]))
On Dec 1, 7:06 pm, Don
On Dec 3, 2:10 pm, ataggart wrote:
> There's take-nth in core, but no drop-nth (which sounds like what you
> need), so I wrote it:
>
> (defn drop-nth [n coll]
> (lazy-seq
> (when-let [s (seq coll)]
> (concat (take n s) (drop-nth n (next (drop n s)
Looks fine in Safari 4.0.3.
On Dec 2, 9:24 pm, Sean Devlin wrote:
> Hey, the API page doesn't look right in Firefox 3.5
>
> The cut off around halfway through the page.
>
> I think this also happens in Safari, but I'm not sure right now.
>
> Oh, and IE 6... YUCK! (But that's expected :))
>
> Sean
On Dec 3, 4:28 am, Tiemo Kieft wrote:
> Hi,
>
> I'm trying to create a matrix, basically it's a vector of vectors. I copied
> the code from ants.clj to create the matrix, however, I have to mirror the
> matrix around it's main diagonal (see below). Currently I'm doing this by
> first creating
On Dec 5, 11:48 am, Christopher Wicklein wrote:
> Greetings!
>
> I'd like to create an instance of a Java class like this:
>
> let [foo (Bar.)]
>
> but, I'd like the type specified by Bar to not be static, e.g. something like
> this:
>
> let [foo (:type params).]
>
> but, I can't seem to get this
On Dec 6, 11:28 am, samppi wrote:
> I've read that loop/recur is less preferable to using higher-level
> function calls like reduce and for and map, especially when chunked
> seqs are implemented. But is can the loop below be rewritten to use
> those functions instead? It's a loop that iterates
On Dec 6, 12:29 pm, Bob Hutchison wrote:
> Hi,
>
> I'm new to Clojure, not new to lisp (CL and scheme), and having a
> thoroughly good time. I've been having a go at the new deftype stuff
> and using a clone of the new branch from the git repository (up-to-
> date as of this message being post
On Dec 6, 7:33 pm, Allen Rohner wrote:
> I started playing with the idea of a hooks library for Clojure,
> similar to Emacs hooks.
>
> You can see the code athttp://gist.github.com/250575
>
> Does this library have the Tao of Clojure?
>
> If hooks aren't a clojure-y way of doing things, what is?
On Dec 6, 9:22 pm, Allen Rohner wrote:
> > What is it supposed to do? What's the usage look like?
>
> Oh right, a description would be useful. The point is to build up the
> functionality of a function from several places. You define a hook
> function:
>
> (defhook foo [a b])
>
> Initially, it
On Dec 6, 8:50 pm, John Ky wrote:
> Hi,
>
> Is it possible to define the functions >, <, >=, <=, ==, min, and max for my
> own defstruct type?
>
> My type is:
>
> (defstruct deadline :value)
>
> where I initialise value with an object of type long.
>
> Thanks
>
> -John
The functions >, <, >=, <=
On Dec 7, 1:21 am, Tzach wrote:
> Hello
> What is the idiomatic way to implement the classic collide-with
> function in Clojure?
> I would like to implement something similar to the following (pseudo
> code ahead):
>
> (defmulti collide-with foo)
>
> (defmethod collide-with ["asteroid" "spaceshi
On Nov 30, 9:21 am, Dan Kefford wrote:
> OK... I'm trying to take Clojure for a spin on Project Euler problems.
> I have source files for each problem that I have solved and although I
> can refer to and invoke any one of them explicitly from a main class,
> I cannot seem to figure out how to re
On Dec 7, 9:07 am, Laurent PETIT wrote:
> 2009/12/7 Hugo Duncan
>
> > On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
> > wrote:
>
> > > Yes, methods are not really functions. Thinking about them as closures
> > > over the object is a good way to go - you can see that analogy in play
> > > whe
On Dec 7, 11:23 am, ataggart wrote:
> On Dec 7, 9:07 am, Laurent PETIT wrote:
>
>
>
>
>
> > 2009/12/7 Hugo Duncan
>
> > > On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
> > > wrote:
>
> > > > Yes, methods are not really functions.
On Dec 7, 12:37 pm, Bob Hutchison wrote:
> On 7-Dec-09, at 12:17 PM, Laurent PETIT wrote:
>
>
>
>
>
> > 2009/12/6 Bob Hutchison
>
> >> On 6-Dec-09, at 3:46 PM, Meikel Brandmeyer wrote:
>
> >>> Hi,
>
> >>> Am 06.12.2009 um 21:29 schrieb Bob Hutchison:
>
> It turns out that dispatching on pl
While we're throwing requests at Tom, it'd be nice if the special
forms were included in the api.
On Dec 7, 5:21 pm, Tom Faulhaber wrote:
> Yup, I heard that the first time :-)
>
> It's coming, but not right this sec.
>
> Tom
>
> On Dec 7, 4:57 pm, Howard Lewis Ship wrote:
>
>
>
> > I still thin
On Dec 7, 4:19 pm, ajay wrote:
> Hi all,
>
> I am new to FP in general and I am trying to pick up Clojure. I am
> having trouble thinking in FP terms.
>
> I am trying to implement the Dijkstra algorithm for shortest paths in
> Graph in Clojure. If this succeeds, I will implement all the advanced
; heap implementation. I wrote one myself as part of an exercise (I
> implemented a simple Huffman-coder), but I'm not sure it's release
> quality. Otherwise, I'd be happy to donate it to contrib. Maybe I'll
> try to clean it up and send it off for a review.
>
>
age --
> From: ataggart
> Date: Tue, Dec 8, 2009 at 6:22 PM
> Subject: Re: Trouble implementing Dijkstra algorithm in Clojure
> To: Clojure
>
> On Dec 8, 11:38 am, Mark Tomko wrote:
> > A priority queue implemented over a heap would be more efficient than
> &g
On Dec 9, 10:20 am, bOR_ wrote:
> Hi all,
>
> I want to make a hash-map where the value of one key depends on the
> values of other keys in the hash-map. Is there a way to do this,
> without needing an external reference to the hash-map?
>
> {:a 1 :b 2 :c #(+ :a :b)}
>
> Similarly, when filling
On Dec 9, 9:46 pm, Mark Engelberg wrote:
> There are only 9 items that satisfy your predicate. (take 10 ...)
> demands a 10th, and it keeps searching the (iterate inc 1) stream
> forever, endlessly searching for that 10th item it will never find.
Aww. You make it sound so sad.
--
You receive
Seconded; I like the intention of both changes, and do something
similar in a lot of my code (e.g., parsing functions that take an
extra arg if the parse is unsuccessful). Also, testing the type of
update-in2's second arg is a bad idea, imo.
As for the breaking change of adding another arg to upd
On Dec 10, 11:02 am, Richard Newman wrote:
> > They're especially useful for inserting println calls for seeing the
> > value of something when I'm debugging; in fact, this is the primary
> > way I do debugging.
>
> (defn tee (x)
> (println "Debug: " (prn-str x))
> x)
>
> (let [x (tee (foo
On Dec 11, 1:14 am, ngocdaothanh wrote:
> > Do you come from a Python background?
>
> For the sake of this discussion, I would say I come from Erlang.
>
> > Judging by you examples, I looks like you're still getting used to the lisp
> > style of coding. Everything is a chained function call.
>
>
On Dec 11, 12:27 pm, Keith Irwin wrote:
> Folks--
>
> I've got a class I can't change which has an abstract method I'd like
> to override using the proxy macro in Clojure.
>
> The class looks something like:
>
> public abstract class Foo {
>
> private Map stuff;
>
> private void initStuff(
On Dec 11, 12:44 pm, Keith Irwin wrote:
> On Fri, Dec 11, 2009 at 12:27 PM, Keith Irwin wrote:
> > public abstract class Foo {
>
> > private Map stuff;
>
> > private void initStuff() {
>
> > stuff = new HashMap();
> > stuff.put("a", new Object());
> > addStuff(stuff);
On Dec 11, 10:44 am, mudphone wrote:
> Thanks for the suggestions.
>
> I think since the original version short circuits when it finds a
> result (using "some"), that's probably what I have to stick with.
Sean's solution does as well.
--
You received this message because you are subscribed to
On Dec 11, 10:33 pm, Richard Newman wrote:
> > (reduce (fn [model f] (assoc model f (inc (get model f 1
> > {} features))
>
> > Do Clojurians usually arrange like that? Can it be rearrange for more
> > understandability?
>
> I can't speak for everyone, but I don't think it's common to
On Dec 11, 4:14 pm, Jason Wolfe wrote:
> I've been trying out the new branch, and on the whole I like it a lot.
> I know it'll take some time to learn how do things properly the "new"
> way, and I've figured out how to do most of the things I want to do
> thus far. Thanks, Rich!
>
> One thing
On Dec 11, 11:44 pm, ataggart wrote:
> On Dec 11, 4:14 pm, Jason Wolfe wrote:
>
>
>
>
>
> > I've been trying out the new branch, and on the whole I like it a lot.
> > I know it'll take some time to learn how do things properly the "new"
&
On Dec 11, 11:56 pm, ataggart wrote:
> On Dec 11, 11:44 pm, ataggart wrote:
>
>
>
>
>
> > On Dec 11, 4:14 pm, Jason Wolfe wrote:
>
> > > I've been trying out the new branch, and on the whole I like it a lot.
> > > I know it'll
If it's a java project, then you can just select the jars, right-
click, choose Build Path > Add to Build Path. You can also do it
through Project > Properties >Java Build Path.
On Dec 12, 6:32 pm, rebcabin wrote:
> I got a lot closer thanks to the great hints above; the current state
> is this
On Dec 14, 5:48 am, Mark Tomko wrote:
> I wrote this implementation of a heap (or priority queue) in pure
> Clojure:
>
> http://pastebin.com/m2ab1ad5a
>
> It's probably not of any quality sufficient to be make it to the
> contrib package, but it seems to work. Any thoughts on how it might
> be
On Dec 14, 11:23 pm, Richard Newman wrote:
> Something I keep bumping into: the SQL library returns rows as struct-
> maps. Often I want to do things like rename keys (:foo_bar => :foo-
> bar), strip out :id columns, etc.
>
> Nope!
>
> java.lang.Exception: Can't remove struct key
>
> Any opin
On Dec 15, 1:49 am, ataggart wrote:
> On Dec 14, 5:48 am, Mark Tomko wrote:
>
> > I wrote this implementation of a heap (or priority queue) in pure
> > Clojure:
>
> >http://pastebin.com/m2ab1ad5a
>
> > It's probably not of any quality sufficient to be m
On Dec 16, 10:33 am, samppi wrote:
> I'm using a vector as a stack. I want to apply a function–let's call
> it modify-element, one argument—to the elements from k to (- (count a-
> vector) k).
>
> Right now, I have something like (not tested yet):
> (reduce #(update-in %1 [%2] modify-element)
On Dec 19, 8:02 pm, Mike K wrote:
> [:foo] evaluates to true by virtue of being a keyword.
To be precise, it evaluates to true by virtue of it not being nil nor
boolean false; being a keyword doesn't really have anything to do with
it.
user=> (cond nil :n false :f (Object.) :t)
:t
--
You rec
1 - 100 of 304 matches
Mail list logo