Hi,
I read a few messages on the new version.
Could someone summarize the changes and the motivation
behind?
Thanks,
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send
So destructuring is essentially doing (first coll) for each parameter
and the rest is assigned (rest coll)?
On Feb 15, 11:48 am, wubbie wrote:
> Also how left and right gets mapped magically to (first tree) and
> (rest tree)?
> Is it destructuring? I have some ideas on destructuring
Also how left and right gets mapped magically to (first tree) and
(rest tree)?
Is it destructuring? I have some ideas on destructuring but this left
and right things confuses me...
thanks
sun
On Feb 15, 11:31 am, wubbie wrote:
> thanks,
> it works, although it does not count ni
t-leaves [[left & right :as tree]]
> (if (seq tree)
> (+ (if (sequential? left)
> (count-leaves left)
> 1)
> (count-leaves right))
> 0))
>
> user> (count-leaves [])
> 0
> user> (count-leaves [1 [2 [3]]])
> 3
> user>
ree)))
> (or tree 0)))
>
> user> (count-leaves [1 2 3])
> 6
> user> (count-leaves [1 [2] 3])
> 6
> user> (count-leaves [])
> 0
>
> On Feb 15, 10:55 am, wubbie wrote:
>
> > Hi,
>
> > Trying to convert to clojure but stumbled on i
Hi,
Trying to convert to clojure but stumbled on it...
(defun count-leaves (tree)
(if (atom tree)
1
(+ (count-leaves (car tree))
(or (if (cdr tree) (count-leaves (cdr tree)))
1
> (count-leaves ’((a b (c d)) (e) f))
10
My clojure version is:
user=> (defn count-leaves
[t
Hi,
Why vector is not a seq?
user=> (seq? [1 2 3])
false
user=> (seq? '(1 2 3))
true
thanks,
-sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googl
thanks!
sun
On Feb 14, 4:34 pm, Brian Doyle wrote:
> On Sat, Feb 14, 2009 at 2:24 PM, wubbie wrote:
>
> > Hi,
>
> > a quick question:
>
> > user=> (keys {:a 1 :b 2})
> > (:a :b)
>
> > But
> > user=> (key {:a 1})
> > java.lang.Cl
Hi,
a quick question:
user=> (keys {:a 1 :b 2})
(:a :b)
But
user=> (key {:a 1})
java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot
be cast to java.util.Map$Entry (NO_SOURCE_FILE:0)
I see defn key in core.clj, though.
What can be the correct usage of fn key, then?
thanks in a
Hi, do we have labels equiv. in clojure?
The code below is from OnLisp. Trying to convert to clj file,
but have minor difficulties.
(defun count-instances (obj lsts)
(labels ((instances-in (lst)
(if (consp lst)
(+ (if (eq (car lst) obj) 1 0) (instances-in (cdr lst)))
0)))
(map
/isDigit
> %
>
> if you prefer a more haskellish form :-)
>
> 2009/2/12 wubbie
>
>
>
> > Hello,
>
> > How can I do this? Do we have a function that checks if
> > it's a char or digit?
>
> > (dig
Hello,
How can I do this? Do we have a function that checks if
it's a char or digit?
(digits "a2c3")
-> "23"
Thanks,
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send
thanks Meikel,
I'll have a look.
Cheers,
sun
On Feb 11, 6:09 pm, Meikel Brandmeyer wrote:
> Hi,
>
> Am 11.02.2009 um 23:59 schrieb wubbie:
>
> > In some post Rich recommended:
> > (let [z (ref 0)]
> > (defn add2 [] (dosync (alter z #(inc %)
>
&
Hi,
In some post Rich recommended:
(let [z (ref 0)]
(defn add2 [] (dosync (alter z #(inc %)
instead of
(let [z (ref 0)]
(defn add2 [] (dosync (refset z (inc @z) ; !!! deref @z again
Then
Is there any way not to deref again for this? It's from ants.clj
(alter oldp assoc :phe
for simplicity, first tried to create two dimentional array(vector) of
numbers.
On Feb 5, 1:58 am, Emeka wrote:
> Where did 'ref' go in your own implementation?
>
> Emeka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
..
On Feb 5, 12:19 am, wwmorgan wrote:
> Here's what I came up with: is it any clearer?
>
> (def board
> (vec (for [i (range dim)]
> (vec (for [j (range dim)]
> (ref (struct cell white)))
>
> On Feb 4, 11:30 pm, wubbie wrote
Hi,
Have some difficulties in reasoning about it.
>From ants.clj,
(def board
(apply vector
(map (fn [_]
(apply vector
(map (fn [_] (ref (struct cell white)))
(range dim
(range dim
Is there any sim
any concrete example?
thanks,
-sun
On Feb 2, 5:13 am, Christian Vest Hansen wrote:
> On Sun, Feb 1, 2009 at 9: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
Hi,
I saw in ants.clj a notation (->).
what is it?
For example,
(defn place [[x y]]
(-> world (nth x) (nth y)))
thanks in advance.
-sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to
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 true
(dosync
(ref-set r1 1)
(non-ref setting fun))
or run this
>
> java clojure.lang.Script test.clj
>
> - the output will be the value of *file* in both cases.
>
> I assume that your CLASSPATH contains path to clojure.jar, otherwise
> you will have to provide it:
>
> java -cp /path/to/clojure.jar clojure.main test.clj
>
the built-in global vars (there is more -
> vars like *command-line-args*, *compile-path* and others in core.clj
> file).
>
> If you really need to see the source of it, look for SOURCE_PATH in
> Compiler.java in Clojure's source code in jvm/clojure/lang directory.
>
> Chee
lojure.core/*file*
> nil
> The path of the file being evaluated, as a String.
> Evaluates to nil when there is no file, eg. in the REPL.
>
> On Jan 29, 7:03 am, wubbie wrote:
>
> > Hello,
>
> > As you see, java.io.File. construct takes path argument but it is the
ire commands player rooms])
(:use [clojure.contrib server-socket duck-streams]))
thanks,
sun
On Jan 28, 8:05 pm, wubbie wrote:
> Hi,
>
> I see
> (add-classpath (str "file://" (.getParent (java.io.File. *file*))
> "/"))
> in mire.clj.
> Wha
Hi,
I saw (.getParent (java.io.File. *file*)) is resolved to parent
directory of current running directory.
java.io.File. is a constructor that takes *file* as an argument, but
I don't see *file* is assgned any value at all.
Is it related to the starup script?
The start-up script has clojure.ma
Hi,
I see
(add-classpath (str "file://" (.getParent (java.io.File. *file*))
"/"))
in mire.clj.
What value of *file* is it? I failed to see *file* is assigned at all.
-thanks
sun
On Jan 27, 1:16 pm, Phil Hagelberg wrote:
> Keith Bennett writes:
> > I'm trying to wrap my head around Clojure's
Oh,
I see (ns mire.rooms ... in rooms.clj
Also see (def *rooms* ...)
So we can refer in other name spaces
the vars and functions in this ns?
Like mire.rooms/*rooms*, mire.rooms/*items*,
mire.rooms/make-room etc?
Thanks
-sun
On Jan 28, 1:18 pm, wubbie wrote:
> The notation mire.rooms/ is
The notation mire.rooms/ is new, especially dod(.) and slash(/).
mire.rooms is rooms in ns mire, etc?
-sun
On Jan 28, 12:50 pm, Phil Hagelberg wrote:
> wubbie writes:
> > @mire.rooms/*rooms* is new to me.
> > could anybody explain to me?
>
> Sure thing. *rooms* is a
ue of *in*/
*out*
(binding [*name* (read-name)
*inventory* (ref [])
*current-room* (ref (@mire.rooms/*rooms* :start))]
On Jan 27, 8:45 pm, "Stephen C. Gilardi" wrote:
> On Jan 27, 2009, at 3:57 PM, wubbie wrote:
>
> > Why defn ends with -(dash
Hi Phil,
Why defn ends with -(dash)?
(defn- mire-handle-client [in out]
On Jan 27, 1:16 pm, Phil Hagelberg wrote:
> Keith Bennett writes:
> > I'm trying to wrap my head around Clojure's concurrency. I'm new to
> > Lisp-like languages, and the examples that I've found are a bit
> > complex.
ilardi" wrote:
> On Jan 25, 2009, at 7:35 PM, wubbie wrote:
>
> > then, back to my original question.
> > They (dorun do all) differe ONLY in return value.
> > Then how come one forces eval and the other not?
>
> Both force evaluation. Is there something that make
ew constantly to be the same as identity except it
> returns a function which can be passed around, rather than the value
> itself.
>
> Finally, you could just as well do '#(identity the-value)' and get the
> same result.
>
> user=> (= (#(identity "ab&q
then, back to my original question.
They (dorun do all) differe ONLY in return value.
Then how come one forces eval and the other not?
-sun
On Jan 25, 7:18 pm, "Stephen C. Gilardi" wrote:
> > On Jan 25, 2009, at 6:45 PM, Laurent PETIT wrote:
>
> >> 2009/1/26 Stephen C. Gilardi
>
> >> Both for
(when (and (seq coll) (or (first coll) true))
(recur (rest coll
On Jan 25, 6:21 pm, "Stephen C. Gilardi" wrote:
> On Jan 25, 2009, at 5:51 PM, wubbie wrote:
>
> > I saw dorun and doall in core.clj as follows:
> > That is, doall just calls dorun.
> > My
Hi,
I saw dorun and doall in core.clj as follows:
That is, doall just calls dorun.
My question is, how come doall does force eval and dorun does not.
thanks in advance,
-sun
(defn dorun
([coll]
(when (and (seq coll) (or (first coll) true))
(recur (rest coll
([n coll]
(when (a
thanks James,
I'll have a look.
-sun
On Jan 25, 2:00 pm, James Reeves wrote:
> On Jan 25, 5:34 pm, wubbie wrote:
>
> > What's the typical usage of fn constantly ?
>
> When you need a function that constantly returns the same result :)
>
> That probably doesn
What's the typical usage of fn constantly ?
thanks
-sun
--~--~-~--~~~---~--~~
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,
How do you define side-effects?
-sun
On Jan 24, 5:26 am, Christophe Grand wrote:
> Tzach a écrit :
>
> > The text on the panel do update.
> > When I try to do the same for all the elements:
> > (for [t (components r)]
> > (.setText t (str 6)))
>
> > Nothing happened.
> > What am I missing
I understand vaguely.
My understanding is that recur is related to tail-call-optimization.
Where can I get more detailed info on recur?
thanks
-sun
On Jan 24, 11:00 am, Meikel Brandmeyer wrote:
> Hi,
>
> Am 24.01.2009 um 16:50 schrieb wubbie:
>
> > I wonder why self-call(
In core.clj, merge is essentially defined using conj.
user=> (merge '(1) 2)
(2 1)
user=> (merge [1] 2)
[1 2]
user=> (merge #{1} 2)
#{1 2}
user=> (conj '(1) 2)
(2 1)
user=> (conj [1] 2)
[1 2]
user=> (conj #{1} 2)
#{1 2}
user=> (conj {:name "ryan"} {:age 25})
{:age 25, :name "ryan"}
-sun
On Jan
Hi,
I wonder why self-call(filter) is used in one place and
recur is used in the other.
(defn filter
"Returns a lazy seq of the items in coll for which
(pred item) returns true. pred must be free of side-effects."
[pred coll]
(when (seq coll)
(if (pred (first coll))
(la
n
> does. Up until now, when I see "when", my eyes have glazed over. Thus the
> only reason I need when is to read other people's code. Good question. Is
> there a reason to have when?
>
> On Sat, Jan 24, 2009 at 9:33 AM, wubbie wrote:
>
> > Here is c
Here is code from core.clj.
The question is when to use when or if.
(defn take
"Returns a lazy seq of the first n items in coll, or all items if
there are fewer than n."
[n coll]
(when (and (pos? n) (seq coll))
(lazy-cons (first coll) (when (> n 1) (take (dec n) (rest
coll)
(some (set "aeiou") "e")
is equiv to
(some #{\a \e \i \o \u} "e")
-> \e
Finally, I can answer, instead of keep asking...
-sun
On Jan 23, 4:04 pm, Mark Volkmann wrote:
> On Fri, Jan 23, 2009 at 2:51 PM, Chouser wrote:
>
> > On Fri, Jan 23, 2009 at 3:47 PM, Mark Volkmann
> > wrote:
>
> >> (c
Is every function supposed to return something?
Of course, except for pure side-effects.
-sun
On Jan 23, 3:02 pm, Vincent Foley wrote:
> The only two false values in Clojure are false and nil. Everything
> else is logically true. If your function returns nil/false or a
> result, you don't ne
thanks
-sun
On Jan 23, 1:43 pm, vthakr wrote:
> Hi Wubble,
>
> Looking at the code you have above I thought I might point out that
> rather than create an anonymous function inside of sum and then call
> it immediately after finishing its description, you could just use the
> loop/recur constru
Thanks Jason.
Anyway I'd like to have (sum) returns 0 so I used [& more].
Is there any way to specify 0 or more args?
-sun
On Jan 23, 12:49 pm, Jason Wolfe wrote:
> Two mistakes:
>
> First, if you want sum to take a vector, you should remove the & from
> the arglist.
> Second, (rest(other)) sh
Hi,
I got the following and don't know what's wrong with it.
thanks in advance.
user=> (defn sum [ & more ]
((fn [total other]
(if other
(recur (+ total (first other)) (rest(other)))
total))
0 more))
#'user/sum
user=> (sum [1 2 3 4])
java.lang.ClassCastException: clojure.lang.Laz
Hi,
Here is def of merge:
(defn merge
[& maps]
(when (some identity maps)
(reduce #(conj (or %1 {}) %2) maps)))
How can I interpret when (some identity maps)?
Thanks
-sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
Hi
I would just print the files, excluding "#".
what's the best way?
user=> (filter recently-modified? (file-seq (File. ".")))
(# # #)
Thanks
-Sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To
thanks, I forgot about that.
sun
On Jan 18, 4:00 pm, "Nick Vogel" wrote:
> You need to do (into [] '(1 2 3)) otherwise it will be read as calling the
> function 1 with arguments 2 and 3.
>
> On Sun, Jan 18, 2009 at 3:56 PM, wubbie wrote:
>
> > Hi,
>
Hi,
Why into does not work for second argument of list?
user=> (into [] (1 2 3))
java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)
user=> (into [] [1 2 3])
[1 2 3]
thanks
-Sun
--~--~-~--~~~---~--~~
You received
Hi,
Just tried a piece of code from here...
(defn my-deref [x]
(if (or (isa? clojure.lang.Ref (class x))
(isa? clojure.lang.Agent (class x))
(isa? clojure.lang.Atom (class x)))
@x
x))
java.lang.ClassNotFoundException: clojure.lang.Atom (NO_SOURCE_FILE:
22)
But I thin
Hi,
is #^ type hint below? I don't see any type at all.
It's from clojure core.
(def
#^{:arglists '([& items])
:doc "Creates a new list containing the items."}
list (. clojure.lang.PersistentList creator))
--~--~-~--~~~---~--~~
You received this message b
Hi
Came across Chouser's posting below:
I know *agent* is for global designation.
My question is how the first agent (agent nil) and *agent* used
later in another nested send-off related?
Also m after (fn is a function name so that it can be referred to
later inside the same function?
Thanks
sun
> Extra pair of []? What do you mean?
Sorry, my bad.
-sun
On Jan 15, 1:25 pm, James Reeves wrote:
> On Jan 15, 2:54 pm, wubbie wrote:
>
> > But in partial desctructuring, [[a [b]] has extra pair of outer-most
> > [] which leads to confusion. Any explanation on th
came across over the net the following examples.
I can understand full destructuring because "[" and "]"
mirrors the structure of tree.
But in partial desctructuring, [[a [b]] has extra pair of outer-most
[] which leads to confusion. Any explanation on that?
Also not sure about the last (on string
(map #(println %) [1 2 3 4]) prints 1 2 3 and 4
But what if the vector element is a hash with
[ {:a 1 :b 11} {:a 2 :b 22} {:a 3 :b 33}]?
can we dereference :a using %1, like (:a %1)?
If not, any alternative? maybe destructuring or something?
thanks
-sun
--~--~-~--~~~-
Thanks David.
-sun
On Jan 14, 11:55 am, David Nolen wrote:
> (:name @(first (:friends @bill)))
>
> You need to dereference before trying to access name.
>
> David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"C
Hi,
Earlier Stuart Sierra replied as follows:
Hi Patrick,
Here's one way to do it:
(defn new-person [name]
(ref {:name name, :friends #{}}))
(defn are-friends [a b]
(dosync
(commute a assoc :friends (conj (:friends @a) b))
(commute b assoc :friends (conj (:friends @b) a
(def bi
Hi,
After (are-friends bill bob) they should be friends,
so I tried @bob
and don't see bill as a friend. why?
@bob
{:friends #{#}, :name "Bob"}
-sun
On Jan 10, 9:44 pm, Stuart Sierra wrote:
> Hi Patrick,
>
> Here's one way to do it:
>
> (defn new-person [name]
> (ref {:name name, :frien
Hi,
How can you add line numbers for each line printed from the file.
Without line number, I have this:
(with-open [rdr (reader "executors.clj")]
(filter #(println %) (line-seq rdr)))
thanks
sun
--~--~-~--~~~---~--~~
You received this message because you are s
thank, it was str as usual.
On Jan 8, 9:22 pm, "Brian Doyle" wrote:
> This works:
>
> (filter #(re-find #"\.clj$" (str %)) (file-seq(java.io.File. ".")))
>
> On Thu, Jan 8, 2009 at 7:16 PM, wubbie wrote:
>
> > I tried
>
> &
I tried
(filter #(re-find #"\.clj$" %) (seq (file-seq(java.io.File. "."
-> java.lang.ClassCastException: java.io.File cannot be cast to
java.lang.CharSequence (NO_SOURCE_FILE:0)
On Jan 8, 9:06 pm, Achim Passen wrote:
> On 9 Jan., 03:03, Achim Passen wrote:
>
> > (filter #(re-find #".clj$
thanks,
Is there anyway to specify regular expression, instead of startsWith/
endsWith?
-sun
On Jan 8, 8:00 pm, James Reeves wrote:
> On Jan 9, 12:48 am, wubbie wrote:
>
> > I can use file-seq
> > (file-seq (File. "."))
> > But how can I filter out all files
Hi all,
I can use file-seq
(file-seq (File. "."))
But how can I filter out all files ending with .clj?
Do we use re-find, re-seq etc?
thanks
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To p
So nested transactions only keep track of nesting level similar to
that in Sybase?
Sun
On Jan 7, 12:18 pm, Rich Hickey wrote:
> On Jan 7, 12:07 pm, "Mark Volkmann" wrote:
>
> > Are there any particular issues with using nested transactions ...
> > dosync inside a dosync ... in Clojure?
>
> Nop
typo...
and looks working...
should be (println (format "%s %d" s i)))
On Jan 7, 10:44 am, wubbie wrote:
> Hi all,
>
> I'm attempting to provide 2 type hints here and not working...
>
> (defn my-fn [#^String s #^Integer i] (println format("%s %d"
Hi all,
I'm attempting to provide 2 type hints here and not working...
(defn my-fn [#^String s #^Integer i] (println format("%s %d" s i)))
(my-fn "hello" (new Integer 123))
Thanks
Sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Hi,
Here is the question on differences between with-meta and #^
Specifically 1) and 2) are different in that 1) has meta info carried
over
to jumping-wubbie, while 2) has not.
What's the rationale behind this?
user=> (def wubbie {:name "Wubbie" :email "wub...@gmail.co
, 2009 at 10:00 AM, wubbie wrote:
> >> user=> (shutdown-agents)
> >> nil
>
> [snip]
>
> >> user=> (send-off my-agent sleep-and-multiply 7 1500)
> >> java.util.concurrent.RejectedExecutionException (NO_SOURCE_FILE:0)
>
> > I don't know wh
both (my-ref :a) and (@my-ref :a) returns 1. hmmm...
On Jan 6, 11:01 am, "Mark Volkmann" wrote:
> Why does this output 1?
>
> (def my-ref (ref {:a 1}))
> (my-ref :a)
>
> I thought I could only access data in a ref by dereferencing it, but
> this shows otherwise.
>
> --
> R. Mark Volkmann
> Obje
Hi,
I tried your example and some weird sequence generates
java.util.concurrent.RejectedExecutionException (NO_SOURCE_FILE:0)
Here is the scenario:
Clojure
user=> (def counter (agent 0))
#'user/counter
user=> (send counter inc)
#
user=> @counter
1
user=> (def my-agent (agent 1))
#'user/my-agent
Ok, I'll do it.
Thanks
Sun
On Jan 5, 6:36 pm, Randall R Schulz wrote:
> On Monday 05 January 2009 15:30, wubbie wrote:
>
>
>
> > Hi,
>
> > I got core dump while running
>
> > ...
>
> > user=> #
> > # An unexpected error has been dete
Hi,
I got core dump while running
It's on linux(ubuntu):
user=> (if true (str "true!") (str "false!")
)
"true!"
user=> (if false (str "true!") (str "false!"))
"false!"
user=> #
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x064f7e68, pid=6500, ti
Hi,
Why are there multiple "Logging str" output.
Also in (apply str-orig args), I don't see any args passed at all!
Thanks
sun
On Jan 5, 2:14 pm, Meikel Brandmeyer wrote:
> Hi,
>
> Am 05.01.2009 um 18:35 schrieb wubbie:
>
> > This example is from clojure s
Hi,
This example is from clojure site.
My question is on line 5 and line 6:
The confusion is str is a function and here looks like used as a
regular variable.
Thanks in advance.
Sun
(defn loves [x y]
(str x " loves " y))
(defn test-rebind []
(println (loves "ricky" "lucy"))
(let [str-orig
Hi,
What's the correct syntax for this code -- from clojure manual.
(import '(java.util.concurrent Executors))
(defn test‐stm [nitems nthreads niters]
(let [refs (map ref (replicate nitems 0))
pool (. Executors (newFixedThreadPool nthreads))
tasks (map (fn [t]
(fn []
(dotimes n niters
(dosync
(
Hi all,
Here is the code from Stu's CL translation.
(defmacro check [& forms]
`(do
~@(map (fn [f] `(report-result ~f '~f)) forms)))
And report-result is:
(defn report-result [result form]
(println (format "%s: %s" (if result "pass" "FAIL") (pr-str form
An example run is:
(chec
Thanks Chouser,
Happy new year!
sun
On Jan 1, 12:37 am, Chouser wrote:
> On Wed, Dec 31, 2008 at 11:41 PM, wubbie wrote:
>
> > Hi all,
>
> > what's the new syntax for this?
> > It is part of the code below which was translation by Stu.
>
> That'
Hi all,
what's the new syntax for this?
It is part of the code below which was translation by Stu.
; using dotimes instead of repeat from cl
(defn plot [f min max step]
(doseq i (range min max step)
(dotimes _ (apply f [i]) (print "*"))
(println)))
Thanks,
Sun
--~--~-~--~
Hi,
Why do we need to specify the second argument(#'func) is a function,
not a variable?
the syntax of send-off required a function as the second arg?
thanks,
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
he first form as the
> second item in second form, etc.
> nil
>
> On Dec 29, 8:27 pm, wubbie wrote:
>
> > Hi all,
>
> > Looking into ants.clj, I came across
> > (defn place [[x y]]
> > (-> world (nth x) (nth y)))
>
> > What -> mean here?
Hi all,
Looking into ants.clj, I came across
(defn place [[x y]]
(-> world (nth x) (nth y)))
What -> mean here?
thanks
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group,
emacs configuration; I
just execute M-x slime to start slime -- Chousuke
(defun run-clojure ()
"Starts clojure in Slime"
(interactive)
(slime 'clojure))
;; To use other Lisps...
;; Incidentally, you can then choose different Lisps with
;; M-- M-x slime
;; (add-to-list
Hi all,
I've been using command line Repl for a while and want to move to
slime/emacs
so I followed instructions in wiki
and got errors in emacs:
I was able to load ants.clj in upper panel.
On the bottom panel, alt -x slime give me the following errors:
(require 'swank.swank)
(swank.swank/ignor
I didn't get the syntax error at all:
The first yields: ([0 0] [0 1] ... [0 99])
The second y ields ([0 1] [0 2] .. [0 100])
I don't know why.
On Dec 27, 4:29 pm, "Michael Wood" wrote:
> On Sat, Dec 27, 2008 at 11:01 PM, wubbie wrote:
>
> > Hi,
> > W
Hi,
Why are they different?
(take 100 (for [x (range 1000) y (range 1000) (< x y)][x y]))
(take 100 (for [x (range 1000) y (range 1000) :when (< x y)][x y]))
Thanks,
Sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
Hi,
I'm trying union/intersection/difference operations, but
got undefined symbols error:
java.lang.Exception: Unable to resolve symbol: intersection in this
context (NO_SOURCE_FILE:22)
Thanks
Sun
--~--~-~--~~~---~--~~
You received this message because you are su
Hi Steve,
It works now.
thanks
Sun
On Dec 23, 9:42 pm, "Stephen C. Gilardi" wrote:
> On Dec 23, 2008, at 9:28 PM, wubbie wrote:
>
> > Hi,
> > I ran it with the changes and got the message:
> > java.lang.IllegalArgumentException: Don't know how to creat
still have error:
s...@wubbie:~/clj-ex$ java -cp clojure.jar clojure.lang.Repl snake.clj
java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Symbol (snake.clj:26)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:4113)
at clojure.lang.Compiler.an
Hi,
I ran it with the changes and got the message:
java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Symbol (NO_SOURCE_FILE:22)
What can be the problem?
thanks
sun
On Dec 23, 6:08 pm, "Stephen C. Gilardi" wrote:
> On Dec 23, 2008, at 5:19 PM, MattyDub wrote:
>
> > On the
Thanks Randall.
My background is mostly in imperative languages, including perl
and perl has closure, so it looks commute uses closure concept
to implement this. Is it right?
Thanks again,
sun
On Dec 16, 9:28 pm, Randall R Schulz wrote:
> On Tuesday 16 December 2008 18:10, wubbie wr
Hello,
My question is that conj takes two argument and how conj finds
the first argument? Is it somehow provided by commute?
Thanks,
sun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to t
Hello,
doall and dorun returns different results from seond run on...
e.g.
user=> (def x (for [i (range 1 3)] (do (println i) i)))
#'user/x
user=> (doall x)
1
2
(1 2)
user=> (doall x)
(1 2)
user=> (doall x)
(1 2)
user=>
user=> (def x (for [i (range 1 3)] (do (println i) i)))
#'user/x
user=> (dor
Hello,
While reading the book, I came across the phrase
"true? tests whether a value is actually true, not
whether the value evaluates to true in a boolean context. The only
thing
that is true? is true:
(true? true)
-> true
(true? "foo")
-> false
Be careful with predicates ..."
My question is wh
Hi Geoffrey,
Thanks for the tip. I put . for every command within the doto.
Also looking forward to having a look at the Qt work you are
currently doing.
Cheers,
Sun
On Dec 12, 4:32 am, "Geoffrey Teale" wrote:
> 2008/12/12 Geoffrey Teale
>
>
>
> > Hi,
>
> > Depending on which version of Cloj
Hi,
The same hello world did not work for me.
The error msgs are:
(defn hello-world []
(qt4
(let [app (QCoreApplication/instance)
button (new QPushButton "Go Clojure Go")]
(.. button clicked (connect app "quit()"))
(doto button
(resize 250 100)
(setFont (new Q
98 matches
Mail list logo