On Sat, January 11, 2014 9:22 pm, Alex Baranosky wrote:
> There is a class of problems where you want to track some state as you
process a seq
This is an interesting exercise. I find said class of problem comes up
fairly frequently and I usually end up with something scary-looking using
reduce or
On 21/11/12 3:10 AM, John Gabriele wrote:
Oh, thanks. My understanding was that current best practice was to
choose a good name, and then if you're the original author, your
project's group-id = artifact-id (and thus you get the
https://clojars.org/my-proj url).
The thought behind Clojars' conv
Ben writes:
> (defn whole-numbers [] (iterate inc 1))
>
> If I use it like this at the REPL
>
> (take (whole-numbers))
>
> I get:
> Java heap space [Thrown class java.lang.OutOfMemoryError]
>
> This unexpectedly is the same result that I expectedly get when
> binding whole-numbers to a t
Mark Engelberg writes:
> Phil makes a reasonable point that it is possible to create a single
> "project" for one-off tasks. I'm not sure how well that would work
> with the way I have things organized, and with my source control, but
> it's something I can look into.
I have a "scratch" project
Lee Spector writes:
> FWIW for some JVM newcomers (like me when I started) #6 involves some
> mysteries related to where exactly the jar should be saved and how
> exactly the other code can be told to find it. It varies depending on
> how you run your code (e.g. whether you have to figure out how
Jeff Heon writes:
> I'm puzzled when we say that Clojure is not particularly OO, but using
> protocols and datatypes feel OO to me,
> except that the namespace of the protocol method implementations is
> decoupled from the namespace of the type.
>
> Perhaps my definition of OO is too loose and I
Michal B writes:
> To use libraries, you need to learn how to operate half a dozen build
> tools and git because each library author distributes their library
> differently.
There is a simple de facto standard, which in typical Clojure-style
we've inherited from the Java community for the sake
Oskar writes:
> Why protocols (and records)? What benefits do I get? Alex mentioned
> polymorphism; how is this different from/related to multimethods?
As Andreas mentioned, yes protocols basically give you a subset of the
polymorphism functionality of multimethods. But they also give you some
Oskar writes:
> I have not heard much about records and protocols. What is a typical
> use case in idiomatic Clojure code for them? Is it a good idea, for
> example, to make a "Character" protocol and "Player" and "Monster"
> records or something in a game. It feels a bit too much like OOP for
>
Hi Oskar!
Excellent questions. I totally agree with you that writing a simulation
in a purely functional style is not the (only) answer in Clojure. After
all the primary goal of the language is to deal with (necessary) state
well, not to get rid of it or hide it.
Oskar writes:
> For the monst
Just sharing the stopgap method for "static HTML" (no server)
ClojureScript development I'm using until someone cooks up a REPL that
evals in the browser instead of Rhino.
Nothing particularly exciting here, but really beats restarting the JVM
on every compile. :-)
This will only work on Linux as
Matthew Phillips writes:
> The only way I can think of to write it in Clojure is:
>
> (reduce
> (fn [items op]
> (let [items1 (if (:delete op) (drop-index (:delete op) items)
> items)]
> (if (:insert op) (cons (:insert op) items1) items1)))
> items ops)
>
> i.e. I'm using a cascade
HB writes:
> I'm trying to implement searching algorithm for binary tree.
>
> (defrecord Node [data left-child right-child])
>
> (defrecord Tree [root])
>
> (defn find-node [tree data]
> "Search for a node"
> (let [root (:root tree)]
> (loop [current root]
> (if (= data (:data curre
John Svazic writes:
Snipping to the relevant portion of the exception (always look at the
last "Caused by"):
> Caused by: java.lang.ClassCastException: clojure.lang.Cons cannot be
> cast to clojure.lang.Associative
> at clojure.lang.RT.assoc(RT.java:664)
> at net.auxesia.chromoso
Mark Fredrickson writes:
> Is the following behavior correct or a bug:
>
> user> (defrecord Example [data] clojure.lang.IFn (invoke [this] this)
> (invoke [this n] (repeat n this)))
> user.Example
> user> (def e (Example. "I am e"))
> #'user/e
> user> (e 2)
> (#:user.Example{:data "I am e"} #:use
Michael Ossareh writes:
> You'll notice in the map returned after the second (extend-protocol)
> that :impls has example.Extender1 listed twice. I assume this is
> because they're different records, though the fact
> that they share the same name is confusing (hence the example of the
> exceptio
Hi Larry,
As a quick temporary workaround you could just set your PATH environment
variable so that it picks up the curl executable from /usr/bin instead
of the broken MacPorts one from /opt/local/bin.
$ which curl
/opt/local/bin/curl
$ export PATH=/usr/bin:$PATH
$ which curl
/usr/bin/curl
You'l
"Eric Schulte" writes:
> Hi,
>
> The following case statement
>
> #+begin_src clojure
> (defn buggy-case [n]
> (case (int n)
> 0 :null
> 1 :load
> 0x7000 :loproc))
> #+end_src
>
> throws the following error
>
> No distinct
Sunil S Nandihalli writes:
> Hello everybody,
> the following code is not producing what was expected of it in clojure
> 1.2 .. has this been fixed the clojure 1.3?
>
> (let [x (transient {})]
> (dotimes [i 10]
> (assoc! x i (* i i)))
> (persistent! x))
This is not a bug, it's a misuse o
Alex Baranosky writes:
> I've been playing with making a macro to encapsulate Stuart's post, like this:
>
> (defmacro defrecord-ifn [name & args]
> `(defrecord ~name ~...@args
> clojure.lang.IFn
> (invoke [this key] (get this key
>
> (defrecord-ifn Foo [a b c])
>
> (def foo (Foo. "A
Todd writes:
> 3. alter ref2 to have a reference (pointer) to ref1
>
> user=> (dosync (ref-set aref2 {:a aref1}))
> {:a # # # #
>
>
> {:java.lang.StackOverflowError
>
>
>
> 4. So, I've got a stack overflow... What's the proper way to deal with
> this? Are circular references like this not allo
Laurent PETIT writes:
> 2010/12/29 Nicholas Wieland wrote:
>
> [...@slicingupeyeballs:~/kenji]$ lein repl
Hehe, nice hostname. :-)
> REPL started; server listening on localhost:21669.
> kenji.core=> (:require 'kenji.hello)
>
> Stop!
> Unles, *cough*, ":require" is a placeholder for
Robert McIntyre writes:
> So there's some sort of "boxing" going on here where the nil produced
> as the values of s-expressions are actually Objects which are nulls,
> while literal nils are actually nulls?
No, there's no boxing going on. They're both just regular Java nulls
(and null is not a
Robert McIntyre writes:
> seems there's no type hint required:
>
> (def t nil)
> (Thread. t)
>
> also works...
>
> How are you able to determine that it's calling the String constructor?
>
> --Robert McIntyre
Ah, no I'm wrong. I was jumping to conclusions. It's the Runnable
one:
(let [^String
Robert McIntyre writes:
> what the heck...
>
> mailing-list.print-from-threads> (Thread. ((constantly nil)))
> #
> mailing-list.print-from-threads> (Thread. ((fn [])))
> #
> mailing-list.print-from-threads> (Thread. ((fn [] nil)))
> #
> mailing-list.print-from-threads> (Thread. (let [this-is-ni
justinhj writes:
> On Dec 26, 11:42 pm, Alex Osborne wrote:
> (defn test-threads [n out]
> (dotimes [x n]
> (.start (Thread. (#(sleeper-thread %1 %2 %3) out x (+ 2000 (rand-
> int 5000)))
Ah. The problem is here. You're calling that lambda in the main thread
justinhj writes:
> I tried passing *out* to my thread function and then binding it to
> *out* in the thread, and this works but then makes the threads execute
> one at a time, and I'm presuming that is because my use of *out* in
> the binding block is blocking for the other threads which use it.
Ken Wesson writes:
>> Actually you don't need to AOT compile records or types. They work fine
>> for interactive development.
>
> Eh. That's not what I saw written elsewhere. Or is it just protocols?
> Though usually those are used hand-in-hand with records.
Perhaps you're thinking of gen-class?
Sunil S Nandihalli writes:
> thanks Alex for your response . I tried it ... It compiled fine .. but the
> double dispatch does not seem to work correctly ..
>
> It some how reverses the arguments and then dispatches to the correct
> function for the reversed arguments and the function works prop
Ken Wesson writes:
> On Sun, Dec 26, 2010 at 7:18 PM, Alex Osborne wrote:
>> Struct maps were in the language for a long time before defrecord was
>> added. Records are supposed to replace them for most purposes. So if
>> in doubt between the two use a defrecord.
>
Sunil S Nandihalli writes:
> http://paste.lisp.org/display/93387
>
> It uses protocols and deftype I noticed that it was an old post .. I
> could not get it to compile to try it out.. I was complaining about
> likes of trying to convert a name-space-qualified to a type name
> .. w.r.t ::Complex .
Damon Snyder writes:
> One of the decisions I wasn't sure about was whether to use a protocol
> or a struct map for the (socket, reader, writer) tuple. I started
> using a struct-map and then switched over to defprotocol/defrecord.
> See
> https://github.com/drsnyder/beanstalk/blob/82f301f1f825b
Glen Rubin writes:
> Can I do the following without using loops??
>
> I have list, e.g.
>
> '(4 6 66 33 26 6 83 5)
>
> I want to partition it so that I get a subset of lists that build up
> to the original:
>
> ( (4) (4 6) (4 6 66) (4 6 66 33) )
(reductions conj [] [4 6 66 33 26 6 83 5])
=>
Michael Ossareh writes:
> Is there a go to place for a roadmap? http://dev.clojure.org/ perhaps?
There's no roadmap as such, Clojure development is not
calendar-oriented. ;-) Last December when people started asking this
question Rich said:
I don't like to publish roadmaps, as often the be
Marek Kubica writes:
> My project is currently quite simple. The program needs a single
> argument, filename, to read from. So I added a :main entry into
> project.clj and started
>
> $ lein run
>
> this took some time and crashed with an exception, because I did not
> specify a file. Well, that
Mark Engelberg writes:
> Looks easy, but your dance and speak methods don't return a value
> which leaves a question in my mind...
>
> If the protocol implementation actually returns a value, do you have
> to explicitly typecast it in Java from Object into the desired type?
Yep, certainly. A Cl
Mark Engelberg writes:
> Are there any examples available of creating a compiled
> class/interface with deftype and defprotocol, and using these from
> Java?
It's pretty straightforward and works exactly how you might expect it
to.
Create a new project:
$ lein new interop
Define a type and
Ken Wesson writes:
>> * OO programs conflate value, state, and identity.
>
> Ah. So, like the confused situations you get with Java's mutable
> collections.
I just thought of a non programming language example which might help
explain what "state and identity conflation" means. The web (as
trad
Ken Wesson writes:
> Ah. So, like the confused situations you get with Java's mutable
> collections. Two lists are equal if they have the same contents in the
> same order -- but then you use one as a key in a hashmap, and then add
> an item to it, and boom! Clojure separates this stuff out becau
Stuart Sierra writes:
> If your REPL implementation runs each command in a new Thread (as most
> of them do, I think) it can just stop the thread. That won't work in
> every situation (for example, a thread blocked waiting for I/O) but it
> will get you out of an infinite sequence.
For just a
Michael writes:
> I'm trying to use << from clojure.contrib.strint perform string
> interpolation in a string variable. The following,
> (def s "v: ~{v}")
> (println (<< (str s)))
> (println (<< s))
This is not going to be possible (at least not efficiently: you could
technically do itwith &en
Todd writes:
> At the end of the day, I'm not sure how valid this exercise is. I'm
> certainly slowly learning clojure...but perhaps learning by way of
> what not do do.
Unfortunately I don't think there's yet any Clojure books that really
focus on teaching functional programming itself like the
Alex Osborne writes:
> Todd writes:
>
>> So far, my experience implementing basic BST functionality in clojure
>> has felt contrived, and was definitely easier in java.
>
> As others have said, implementing mutable data structures in Clojure is
> going against the gr
Todd writes:
> My main question is, what tasks/apps is clojure ideally suited for?
>
> I've been playing with implementing Binary Search Trees in clojure and
> Java as a way to learn clojure and compare the two languages. My
> original thought was to implement some basic data types and algorithms
javajosh writes:
> Just ran across:
>
> http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html
>
> Whoah! I had no idea there was so much, uh, 'intricacy' going on
> behind Lisp. :)
>
> Anyway, it was interesting to read it having a bit of Clojure under my
> belt. With the exc
Michael Ossareh writes:
> There are 54874 companies in the companies var. The OOM tends to take place
> when there are 1000 or so companies to process.
>
> What is likely to be causing this issue?
I replied on IRC but just recapping here.
I think you've probably been bitten by the way Java str
Sunil S Nandihalli writes:
> I would like to know what meta info does &form that get passed to
> your macro.. actually contain? I am able to only get the line
> number.. Is there a way to get the file name aswell?
The currently evaluating/compiling file (if it is a file and not the
REPL or some
HB writes:
> I checked clj script under the script directory:
>
> #!/bin/sh
>
> CLASSPATH=src/clj:test:test-classes:classes/:script/
> jline-0.9.94.jar:../clojure-contrib/target/clojure-contrib-1.2.0-
> SNAPSHOT.jar
>
> if [ -z "$1" ]; then
>exec java -server jline.ConsoleRunner clojure.main
HB writes:
> Ken & Alex,
> Why you aren't calling empty? when you want to check if a collection
> is empty?
Here's the definition of empty? from clojure/core.clj:
(defn empty?
"Returns true if coll has no items - same as (not (seq coll)).
Please use the idiom (seq x) rather than
HB writes:
> OMG, this is too much Clojure code for me to handle O.o
> Alex, you just killed me :)
Hehe, sorry. Just thought it might be helpful to show the progression
of dealing with all the little edge cases.
It perhaps looks much more fiddly, but you're doing more there than
common lisp:
HB writes:
> I'm trying to write a function that calculates the length of a list:
>
> (defn list-length [col]
> (if col
> (+ 1 (list-length(rest col)))
> 0))
>
>
> (list-length '(Java, Clojure, Scala))
>
> Upon running it in the REPL, I got the error:
> java.lang.StackOverflowError (tes
Brian Marick writes:
> Is there any way to get the original call form? Something like &env? Some
> hook into the reader?
Try &form
--
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 t
Sunil S Nandihalli writes:
> I really like the &env. It has saved a lot of tedious work a couple of
> times .. but I have only found use for the keys of the map that gets
> passed like in the following example.
> I don't understand what the val part of the map contains? I have
> failed at attem
patrickdlogan writes:
> Java has a file watch API to avoid polling.
I assume you're talking about the NIO 2 watch service? That's not
yet in a released version of Java, it's coming in Java 7.
> Stuart Sierra uses it to good effect in lazytest.
It looks to me like lazytest polls the last modif
viksit writes:
> What would you recommend as the best method to tail a file using
> Clojure? Are there any built in functions in contrib or core that
> allow a program to read the last line of a file as it is appended to?
> If not - how do people solve a problem like this?
>
> My aim is simple -
Ken Wesson writes:
> It looks an awful lot like swap! itself is implemented with a polling
> sleeplock instead of using the language's own lock. :)
I suppose it's similar to a spinlock simply because it keeps retrying,
like a spinlock keeps retrying to acquire. Very different semantics
though:
Ken Wesson writes:
> Retries? We were discussing an atom here, not a ref. A dosync
> transaction may be retried. The obvious implementation for swap! would
> be (locking inner_value (set! inner_value.contents (apply fun
> inner_value.contents))) (warning: pseudocode, I assume this stuff
> would a
Ken Wesson writes:
> I put a println in a swap! function once and the world didn't end.
For a println retries are usually harmless, it just means you'll
occasionally get doubled output. But it's not a good thing for a
general-purpose runonce fn whose entire reason for existence is to
ensure som
Ken Wesson writes:
> On Tue, Nov 30, 2010 at 5:27 PM, Robert McIntyre wrote:
>> (defn runonce
>> "Create a function that will only run once. All other invocations
>> return the first calculated value. The function can have side effects.
>> Returns a [has-run-predicate, reset-fn, once-fn]"
>>
John Fingerhut writes:
> Does anyone know a way from within a Java/Clojure program to determine
> which GC algorithm is currently in use? I'm curious what the default
> is when one is not specified on the command line, and accessing the
> one being used from inside of a program would be one good
Andreas Kostler writes:
> Is this a 'bug' with eval?
No, eval is a simply a function and so like any other function it can't
"see" the lexical (local) environment which it was called from.
Doing this:
(let [a 1, b 2] (eval '(+ a b)))
Is similar to doing this:
(defn cake []
(+ a
Mike Meyer writes:
> My simple web app
> (http://blog.mired.org/2010/11/x10-controller-in-clojure.html) has
> some stuff that needs to happen just once (in this case, opening the
> serial port). It's not clear how to get this to happen using ring. If
> I do it inside my ring handler, then it gets
"nicolas.o...@gmail.com" writes:
> I doubt there is a foldr that handles the infinite list.
> To do anything, it would have to read at least one element: the last.
>
> Alex nice answer is a foldl.
Actually I think you have them backwards. Wikipedia has a pair of
diagrams which I find very usefu
Alex Osborne writes:
> benjii writes:
>
>> (ns org.codingkata.unit.MyKata
>> (:import (org.codingkata.unit.api.BaseKataSolution)
>> (org.codingkata.unit.api.BaseKataSolution$Day))
>> (:gen-class
>>:extends org.codingkata.unit.api.BaseKa
benjii writes:
> Hi, i'm pretty new to clojure.
> To help me to progress i'm trying to solve the kata available on
> codingkata.org
> I'm doing the ovie-tickets kata.
> As you can se on the site, to complete this kata we need to acces to a
> enum wich is a nested class.
>
> My problem is that
James Reeves writes:
> I've just tried installing autodoc 1.7.1 and 0.8.0-SNAPSHOT via
> Leiningen and Clojars, and it seems to be missing some dependencies
> (specifically org.apache.maven:super-pom:jar:2.0).
*sigh* This is a case of Maven being totally misleading and also a case
of death by s
tpeng writes:
>> (defn foldr [f coll]
>> (reduce #(f %2 %1) (reverse coll)))
> but this foldr can't handle the infinite list, am i right?
Correct. In a lazily evaluated language like Haskell you can have a
combining function which doesn't always evaluate its arguments and thus
only partially
Alex Baranosky writes:
> So for the case I had that method worked. I wonder though if I had
> wanted to sort by multiple keys, with some of the keys sorting in
> reverse order and others in regular order, how I could do that... Say
> last name ascending, date of
> birth descending for example.
Glen Stampoultzis writes:
> (sort-by :last-name #(compare %2 %1) persons)
>
>
> Actually having put forward that second example there I'm not sure how
> it actually works. The docs suggest that the 2nd parameter needs to
> implement Comparator (peeking at the source confirms this) but co
Alex Baranosky writes:
> I'm trying to figure out how to use sort-by in reverse order.
I tend to do this:
(sort-by :foo #(compare %2 %1) coll)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroup
Dilvan writes:
> Do you know how can I "bootstrap" Clojure before using any Clojure
> specific data structure (from Java or Jython)?
It seems to be fine if you put it on the Java system classpath instead
of python.path:
$ jython -J-cp clojure-1.2.0.jar
Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2
Sunil S Nandihalli writes:
> why does (clojure.repl/source in-ns) not work while (doc in-ns) gives
> the documentation?
in-ns is implemented in Java code. There's no (Clojure) source for it
to show you. Another one is load-file.
--
You received this message because you are subscribed to the
Alyssa Kwan writes:
> Perfect! That makes things so much easier! I assume that interning
> vars is synchronized then? This is the second big source code read
> FAIL in two days. Obviously I can't read. :)
They're stored in an AtomicReference (basically an atom).
> All persistence requires
Hi Alyssa,
Alyssa Kwan writes:
> For what I'm doing (making functions durable), it raises the
> question: If you persist a function that points to a var, restart the
> JVM, and deserialize/load the function from a data store, what should
> happen?
So you're doing something like this?
(def
Alyssa Kwan writes:
> I understand exactly why this situation exists. I just think the
> behavior is unexpected. When I create a function with a dynamic
> binding, I expect the function to keep a reference to the *name*, not
> the var that the name resolves to at compile/clinit time.
Oh, I see
Alyssa Kwan writes:
> In any case, I am using Github master and I thought I was using 1.2.
> 1.2 has self-references lexically bound, as David Sletten points out,
> which I agree is the correct behavior. But something has happened on
> 1.3 alpha that has changed that. I don't know if it's inten
Hi Alyssa,
Alyssa Kwan writes:
> ns-unmap isn't typically used. But for durability, we can think of
> JVM shutdown/startup as unmapping everything and starting fresh.
> Therefore, expected behavior for ns-unmap should be the same as
> behavior for deserializing and loading an object after a new
Hi David,
David Soria Parra writes:
> any feeback on this so far?
>> A typical example would be:
>> (digest-to-str (digest "hello world" :algorithm "SHA-1"))
"digest-to-str" is a bit misleading as hexadecimal digits are not the
only way you can represent a digest as a string: base 64 and base 3
Brian Wolf writes:
> Whats the idiomatic or best method to develop patches to pre-exisitng
> libraries using clojars, do I git the source to my computer, put put
> [lein-clojars "0.5.0"] in project file, obviously renaming the
> project, and do I take original dependenicies out, or leave in, or
Brian Watkins writes:
> I'll try rem for time but I see that I still have to cast to long;
> Clojure doesn't think (rem (long ) (long x)) is a long. The
> error is "recur arg for primitive local: nf must be matching
> primitive."
Looks like it's casting it back to an integer. Also look
Paulo Candido writes:
> I have a script, say "foo.clj" in a namespace "com.company.ns".
> "foo.clj" uses functions from another script, "bar.clj" in the same
> namespace. "foo"'s namespace has the line "(:use com.company.ns.bar)".
> It works in the REPL, it works inside Netbeans with Enclojure.
>
e writes:
> Can you imagine how disruptive it would be at this point to do it the
> other way around? If you were starting out today without any Lisp
> baggage, it seems TOTALLY obvious to me that lists would have been (1
> 2 3), and the *calling of a function* would have been the different
> th
Lee Spector writes:
> Sorry, the expression in my first sentence should have been "(. (new
> java.util.Random) (nextInt X))", not "(. (new java.util.Random)
> X)". In any event the real question isn't about this call but about
> how Clojure's rand-int should handle bignum arguments and about how
klang writes:
> laprepl starts up with the following error and localhost:8080 does not
> respond
>
> kl...@feersum:~/projects/labrepl$ script/repl
> Clojure 1.2.0-master-SNAPSHOT
> java.lang.ExceptionInInitializerError (control.clj:9)
Looks like labrepl is not locked to a particular version of Cl
Hi Matt,
Matt Culbreth writes:
> I'm using slurp to read data from a file and send it to a stream, but
> sometimes that's failing. I've got a theory that it has to do with
> slurp not reading binary data correctly. Is that true? Do I need to
> go down to the lower level Java classes and build
ka writes:
> Above I wrote a macro with-open-flexi! ... which I'm planning to use
> in my app's API . .. please let me know if there are any bugs /
> gotchas / improvements etc...
>
> I didn't get any responses, so does it means there is something so
> obviously wrong that you can't even begin wh
Gregg Williams writes:
> Now I'm working on
> the "Graph Editor" program described at
> http://www.piccolo2d.org/learn/grapheditor.html
> .
>
> In this sample program (which you don't really need to look at) I need
> to subclass a Piccolo2D class to create a class named GraphEditor ,
> but unlik
Hi Gregg,
Gregg Williams writes:
> (ns genclassInteger
> (:gen-class
>:extends [java.lang.Integer])
> ;(:import (java.lang Integer)) ; < unnecessary, right?
> )
> -
>
> This returns the error:
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> [java/lang/
Phil Hagelberg writes:
> So it seems like recently the only thing I use AOT for is producing
> -main functions that can be easily run from the command-line. I've
> found that an alternate to this is to use clojure.main -e, require the
> necessary namespace, and then call (apply -main *command-lin
Douglas Philips writes:
> Looking at the clojure.org front page, there is no "roadmap" link, or
> anything that seems to be like that, to know what is on the radar,
There's no formal roadmap as such, most open-source projects just don't
tend to work that way.
Working notes and ideas are often p
Kevin Livingston writes:
>> Not at all. next is basically #(seq (rest %)); you might want to use
>> it when the extra bit of strictness is beneficial to your code and you
>> shouldn't use it when it isn't.
>
> oh, ok. I saw some posts on using the new super-lazy lists / code and
> it implied tha
Stuart Halloway writes:
> The second level header tells you the branch (e.g. master). On the
> left hand side is a list of branches (so you can click on e.g. 1.1.x).
>
> Some ways I see this might be better:
>
> (1) make clear what master currently equals (right now it is 1.2 alpha)
> (2) highlig
ka writes:
> The whole code gets cluttered with all these try finally (and one
> catch) statements.
>
> (try
> (let [conn1 (API1/getConnection ..)]
> (try
> (let [conn2 (API2/getConnection ..)]
> (try
> ( ... Do something with conn1 conn2
Hi Neal,
Neal writes:
> I'm trying to use duck-streams, but it is missing from the clojure-
> contrib JAR file (at least in build #81). I have listed the contents
> of the JAR file and confirmed that it is not in there.
It sounds like you're using a 1.2 pre-release snapshot build of
clojure-co
ka writes:
> How can I do something like ...
>
> (try
> (let [conn (API/getConnection ..)]
> ())
> (catch ..)
> (finally (if conn (API/closeConnection conn
>
> Problem is that conn is unavailable in the finally context.
Why not just have two try blocks?
(try
(let [conn (API/g
B Smith-Mannschott writes:
> expected: nil
> actual: java.lang.IllegalArgumentException: No method in multimethod
> 'sqrt' for dispatch value: :clojure.contrib.complex-numbers/complex
Just thought I'd expand on what the problem was.
I was able to reproduce this on an older Linux machine and n
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 classes, one of which is:
>
> bar$foo__5.class
The numbers are just a global incrementing counter (the same one used
Per Vognsen writes:
> Nice! Towards a similar purpose, I wrote a little Emacs hack last week
> that web-scrapes clojars.org and inserts the artifact declaration at
> the cursor. Since I had to rely on their search feature, I couldn't do
> proper regular expression matching.
I've cronned a job t
Tassilo Horn writes:
> To get swank-clojure.jar I need to check out the project from github and
> use "lein jar" to generate the jar, right? Or is it possible to
> download a ready-made jar?
You can just download it by hand from Clojars if you like:
http://clojars.org/repo/swank-clojure/swank-
Tassilo Horn writes:
> To me, all this stuff seems to magical, for example that swank-clojure
> downloads the required clojure/contrib jars (at least the comment in the
> el-file says so). How do I know what version it will fetch? How does
> it know when to update those jars?
It will only down
1 - 100 of 228 matches
Mail list logo