Hi,
Am 01.02.2009 um 12:26 schrieb ivant:
Right. What I meant is, that some systems have a limit on the number
of parameters. I don't know if JVM has such limit (besides total
memory) or not.
I think there is upper limit of what is defined in Clojure. For apply
there is applyTo in IFn. Whic
My understanding of commute is that it would not restart the transaction, it
would just apply the function. So I wrote this little test program:
(defmacro in-thread [& body]
`(.start
(Thread.
(fn []
(println "Thread" (.getId (Thread/currentThread)) " started")
~...@body
I noticed that some multi-word functions separate the words with a
hyphen while others don't. For example, butlast and drop-last. Surely
changing names of core functions now would break lots of code, but I
wonder if it would still be worthwhile in the long run to do this
before 1.0 is released.
-
i was confused by the meaning of coll, too . . .even at a more basic level
of not knowing that it meant collection. I even thought at first I was
seeing "col1" or that the second lower('L') was a capitol(i). I read it as,
"column one" in my head.
Is it accurate to call it "some-seq" or something?
"loop is exactly like let, except that it establishes a recursion point
at the top of the loop, with arity equal to the number of bindings. See
recur."
(let [[a b] [1 2]]
[a b])
=> [1 2]
(as expected)
However:
(loop [[a b] [1 2]]
(if (= a 2)
true
(recur [(+ a 1) (+
On Feb 1, 1:27 pm, Jan Rychter wrote:
> (loop [[a b] [1 2]]
> (if (= a 2)
> true
> (recur [(+ a 1) (+ b 1)])))
>
> java.lang.NoClassDefFoundError: clojure/core$loop__4287$fn__4289
> (NO_SOURCE_FILE:1)
> [Thrown class clojure.lang.Compiler$CompilerException]
It works for
On Jan 28, 4:14 am, ivant wrote:
> On Jan 26, 1:31 am, "Stephen C. Gilardi" wrote:
>
> > The usual way to do this is with "(apply str ...)"
>
> I just wonder if there is a limit to how long the sequence can be,
> because apply should use the Java calling stack, right?
Coming from CL I was surpr
Hi,
Am 01.02.2009 um 14:27 schrieb Jan Rychter:
(loop [[a b] [1 2]]
(if (= a 2)
true
(recur [(+ a 1) (+ b 1)])))
1:1 user=> (loop [[a b] [1 2]]
(if (= a 2)
true
(recur [(+ a 1) (+ b 1)])))
true
java.lang.NoClassDefFoundError: clojure/co
On Sun, Feb 1, 2009 at 8:14 AM, Adrian Cuthbertson
wrote:
>
> I would say "thread" is used here colloquially - i.e. "works the expr
> through the forms" and "form" is as defined in clojure.org/reader.
Well ... not really. There is no place on that page that says anything
like "A form is ...". It
I was able to work through the first two examples, and thanks for those. I
will have to study maps more, I guess, to understand the last one. I don't
know where 'x' came from:
>
> user=> (-> x :one :b)
> 2
>
>
--~--~-~--~~~---~--~~
You received this message becau
is there a definition of "thread" somewhere, and a definition of "form"
somewhere?
Thanks.
On Sat, Jan 31, 2009 at 10:31 PM, Jason Wolfe wrote:
>
> On Jan 31, 7:09 pm, wubbie wrote:
> > Hi,
> >
> > I saw in ants.clj a notation (->).
> > what is it?
> > For example,
> > (defn place [[x y]]
> >
Sorry! That should have read;
(-> m :one :b)
2
On Sun, Feb 1, 2009 at 5:13 PM, e wrote:
> I was able to work through the first two examples, and thanks for those. I
> will have to study maps more, I guess, to understand the last one. I don't
> know where 'x' came from:
>>
>> user=> (-> x :one
I would say "thread" is used here colloquially - i.e. "works the expr
through the forms" and "form" is as defined in clojure.org/reader.
On Sun, Feb 1, 2009 at 4:01 PM, e wrote:
> is there a definition of "thread" somewhere, and a definition of "form"
> somewhere?
>
> Thanks.
>
> On Sat, Jan 31,
On Feb 1, 2009, at 6:47 AM, Paul Barry wrote:
> My understanding of commute is that it would not restart the
> transaction, it would just apply the function. So I wrote this
> little test program:
>
> (defmacro in-thread [& body]
> `(.start
> (Thread.
> (fn []
>(println "
On Sat, Jan 31, 2009 at 8:01 AM, wubbie wrote:
>
> Hello,
> I'd like to separate dosync and other funcs as follows.
> Any comment? Essentially I want to allow more concurrency.
>
> (if true
> (do
> (dosync (ref-set r1 1))
> (non-ref setting fun))
> (else-fun))
>
> Instead of
> (if
On Jan 28, 3:19 pm, Timothy Pratley wrote:
> > I just wonder if there is a limit to how long the sequence can be,
> > because apply should use the Java calling stack, right?
>
> str is only called once, with many arguments:
> user=> (apply str (range 1))
>
> Only limit is total memory (like a
Meikel Brandmeyer writes:
> Am 01.02.2009 um 14:27 schrieb Jan Rychter:
>
>> (loop [[a b] [1 2]]
>>(if (= a 2)
>> true
>> (recur [(+ a 1) (+ b 1)])))
>
> 1:1 user=> (loop [[a b] [1 2]]
> (if (= a 2)
>true
>(recur [(+ a 1) (+ b 1)])))
> tr
I recently wrote on my blog that using #' was a good way to make sure
that you get the function definition you want despite the symbol being
rebound within a let. For instance:
(let [list 10]
(#'list 1 2 3))
=> (1 2 3)
cgrand responded (here:
http://www.reddit.com/r/programming/comments/7tn
On Sun, Feb 1, 2009 at 1:13 AM, falcon wrote:
>
> +1 for this request. I have a question as well, aren't the namespace
> bindings stored in one of clojure's concurrency objects?
Namespace mappings and aliases are each currently stored in a
java.util.concurrent.atomic.AtomicReference
Since Cloj
On Feb 1, 2009, at 12:04 PM, Eric wrote:
So, my question is this: what is the difference/relationship between
#' and the fully-qualified name?
#'x is a sequence of characters that the reader (LispReader.java)
translates into (var x) when reading. (see http://clojure.org/special_forms#var)
On Feb 1, 12:16 am, Meikel Brandmeyer wrote:
> Hi,
>
> Am 01.02.2009 um 03:26 schrieb Onorio Catenacci:
>
> > (defn init-sheet
> > #^{:doc "Initialize a worksheet with a particular month"}
> > ([current-month]
> > (if debugging (println "In init-sheet"))
> > )
> > )
>
> You do
git://github.com/kreg/traceme.git
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
clojure
Anyone have a better method to go from a symbol to a namespace
qualified symbol? I'm using this ugly kludge now:
(symbol (.substring (.toString (resolve sym)) 2))
I'm keeping a map of currently traced functions and the key is the
namespaced-qualified symbol of the function. See
git://github.com
Make that http://github.com/kreg/traceme/tree/master to just view the
project.
--~--~-~--~~~---~--~~
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
To unsubscr
Hi sun,
I thought this question looked familiar. I found some answers here
also:
http://groups.google.com/group/clojure/browse_thread/thread/1f21663ea1ae9f58/
Kev
On Feb 2, 2:29 am, Adrian Cuthbertson
wrote:
> Sorry! That should have read;
> (-> m :one :b)
> 2
>
>
>
> On Sun, Feb 1, 2009
More as a note to future Clojure doc'ers than anything else: It seems
that noobies (including myself) get bitten by the lazy versus
immediate evaluation functions all the time (e.g. for versus doseq/
doall). If this problem isn't solved through naming conventions
(probably way too tedious to be
This may be obvious to others, but what's the motivation behind it? Is it
that we are very concerned about combatting the criticism that lisp has too
many parens?
On Sun, Feb 1, 2009 at 3:09 PM, kkw wrote:
>
> Hi sun,
>
>I thought this question looked familiar. I found some answers here
>
i was talking about something related in the chat group, but I'm not good
enough yet to implement it. I want to rewrite the doc method slightly in a
way that would go a LONG way for newbies. The current way actually looks
like java . . . like the parens are around the input params. But that's
ju
On Feb 1, 2009, at 2:44 PM, Craig McDaniel wrote:
Anyone have a better method to go from a symbol to a namespace
qualified symbol? I'm using this ugly kludge now:
(symbol (.substring (.toString (resolve sym)) 2))
I'm keeping a map of currently traced functions and the key is the
namespaced-qu
Hi Rich, hi all,
A question: is it possible to kill or interrupt an agent during a long-
running action, e.g.,
(def the-agent (agent nil))
(send-off the-agent really-long-action)
;; Oops, I changed my mind.
(interrupt the-agent)
;; The thread running really-long-action stops,
Thanks so much!
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
clojure+unsubscr...@googl
On Feb 1, 3:35 pm, e wrote:
> This may be obvious to others, but what's the motivation behind it? Is it
> that we are very concerned about combatting the criticism that lisp has too
> many parens?
>
Applying functions in succession without giving a name to each
intermediate value can be very
Hi Stuart,
> One option would be to use a second agent as a flag. My really-long-
> action function could periodically check the value of that agent, and
> terminate if it's been set to true. But would it be possible to
> provide a generic interrupt mechanism that doesn't require modifying
> th
I've changed the name of my project since that was a joke anyway.
http://github.com/swannodette/spinoza/tree/master
Spinoza isn't just for people who want object oriented behaviors. It's also
for anyone who plans on instantiating many structs. Spinoza's make-instance
macro automatically orders y
Hello everyone,
For the past few weeks, I've been having problems with my Internet
connection, losing my signal for hours sometimes and during that time,
I cannot program, because I don't have access to the Java API
documentation.
I looked on Sun's site, but I couldn't find a way to download it.
On Feb 1, 2009, at 9:54 PM, Vincent Foley wrote:
Does anyone know where I could get [downloadable Java API
Documentation] in HTML format?
On this page:
http://java.sun.com/javase/downloads/index.jsp
search for
Java SE 6 Documentation
The file "jdk-6u10-docs.zip" unzips t
The selections function in combinatorics returns more than what I
need. (selections [ 1 2 3 4 5] 3) will return both (1 2 3) and (3 2
1), etc. However, I still need (1 1 1) (2 2 2), etc. I've tried
several times to write a function to filter out the 'duplicates', but
haven't quite got it.
--~--
I'm not sure exactly what you want to remove, but it sounds like you
might be looking for something like:
(set (map sort (selections [1 2 3 4 5] 3)))
or:
(for [i (range 1 6) j (range i 6) k (range j 6)] [i j k])
On Sun, Feb 1, 2009 at 8:12 PM, kyle smith wrote:
>
> The selections function in
On Sun, Feb 1, 2009 at 8:25 PM, Mark Engelberg wrote:
> (set (map sort (selections [1 2 3 4 5] 3)))
or
(distinct (map sort (selections [1 2 3 4 5] 3)))
if you want to generate the values lazily rather than all at once.
--~--~-~--~~~---~--~~
You received this mess
Thanks Steve. I'm going with your suggestion to use the var itself
rather than the symbol as the key. It simplifies things.
-Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this gro
I've written up a fast, iterative version of a "unique-selections"
function, consistent with the approach taken in the other
combinatorics functions.
http://paste.lisp.org/display/74710
I haven't benchmarked it, but I would expect this version to be the
fastest of the alternatives mentioned here
Name: clojure.contrib.server-socket.clj
URL:http://code.google.com/p/clojure-contrib/
Author: Craig McDaniel
Category: net
License: ECL
Description: An enhancement of Rich's original socket-server example
that keeps track of client connections, closing them when the go away.
It also includes a
42 matches
Mail list logo