On Mon, Oct 26, 2009 at 6:20 AM, Stuart Sierra
wrote:
> Can't be done. Once a fn is compiled, it's just Java bytecode.
On the other hand, size of the generated byte code is moderately
interesting (as is runtime performance in time and heap).
I do *love* the fact that the analysis can be done i
Sweet! So that worked. However, even though unlikely, i would like to
avoid symbol collision. So i tried something like this
(ns ide.handlers
(:use clojure.contrib.with-ns))
(defmacro new-handler-class
[classname-sym event & body]
(let [hinted-this (with-meta 'this {:tag classname-sym})]
On Sat, Oct 24, 2009 at 9:10 PM, John Harrop wrote:
> On Sat, Oct 24, 2009 at 10:19 PM, Robert Stehwien wrote:
>
>> Hadn't seen it posted here yet:
>> http://sicpinclojure.com/
>>
>
> Are they looking for help writing Clojure versions of the Scheme code
> snippets?
>
> -
>
I'm not sure if the cr
Thanks for the link.
I read somewhere that Rich asked folks to vet stuff on this Google
Group first, so that's why I posted it here.
I previously posted a "patch" to Clojure here and Rich applied it. I
didn't have to do the CA, and if posting my patches into the public
domain works - then please
Rather than the number of nodes in a tree, I think a better metric
would be the number of edges in a graph. Variables that are
referenced on many different lines should get double counted. I think
this would explain why imperative spaghetti code is so complex. On
the other hand, I suspect func
Well, that's how the key itself is useful. What I'm wondering is why
it is useful for the key to be passed to the watching function every
time it's called.
On Oct 26, 1:13 pm, pmf wrote:
> On Oct 26, 8:12 pm, samppi wrote:
>
> > According to the docs, the function passed into an add-watch call
Hi,
Am 26.10.2009 um 18:55 schrieb Abhijith:
> (defn foobar [arr--of-arr]
> (let [ acc (transient {}) ]
>(doseq [ [i e] (indexed arr-of-arr) word e ]
> (assoc! acc word (if-let [v (acc word)] (conj v i) [i])))
>(persistent! acc)))
I think the problem is the wrong use of transients.
On Mon, Oct 26, 2009 at 1:55 PM, Jason Wolfe wrote:
> Hi Mark,
>
> Thanks for the patch! Have you seen this page?
>
> http://clojure.org/contributing
>
> You should follow the instructions there to get your patch included.
> In particular, that page tells you where to post it, and has other
> de
On Oct 26, 8:12 pm, samppi wrote:
> According to the docs, the function passed into an add-watch call
> receives four arguments. Its first argument is a "key". This key seems
> to be the same key as the key passed into the add-watch call, and so
> would always be the same, for the same ref and fu
According to the docs, the function passed into an add-watch call
receives four arguments. Its first argument is a "key". This key seems
to be the same key as the key passed into the add-watch call, and so
would always be the same, for the same ref and function. What is the
point of this argument
On Mon, Oct 26, 2009 at 1:55 PM, Abhijith wrote:
>
> Hello everyone,
> I am having problems with destructuring in doseq.
>
> The function below basically takes an array of arrays as its argument
> and returns a mapping of the elements to the index in the outer array.
>
> (use 'clojure.contrib.se
Hello everyone,
I am having problems with destructuring in doseq.
The function below basically takes an array of arrays as its argument
and returns a mapping of the elements to the index in the outer array.
(use 'clojure.contrib.seq-utils)
(defn foobar [arr--of-arr]
(let [ acc (transient {})
I agree, use Clojure vectors whenever it's feasible. Even within
Incanter, which uses Parallel Colt extensively, I try never to convert
Clojure vectors into Colt vectors/matrices unless it's absolutely
necessary.
David
On Oct 26, 2:23 pm, Konrad Hinsen wrote:
> On 26 Oct 2009, at 17:14, Rock
On 26 Oct 2009, at 17:14, Rock wrote:
> Just one more thing. It's still not really clear to me if I am better
> off using Java arrays (make-array ...) or clojure vectors especially
> when dealing with multidimensional arrays. I know that if use Java
> libraries such as Colt, I have no choice. But
Hi Mark,
Thanks for the patch! Have you seen this page?
http://clojure.org/contributing
You should follow the instructions there to get your patch included.
In particular, that page tells you where to post it, and has other
details; for instance, you must send a CA to Rich before any code you
This seems like an even better place to post it:
http://paste.lisp.org/display/89307
--~--~-~--~~~---~--~~
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
Not
I imagine you'll be better off with the flexibility and ease of nested
vectors unless you have very specific performance needs (e.g. you need to
pass the arrays frequently to third-party libraries that accept Java arrays,
or for performance reasons you want to mutate them in place using amap
etc.)
Just one more thing. It's still not really clear to me if I am better
off using Java arrays (make-array ...) or clojure vectors especially
when dealing with multidimensional arrays. I know that if use Java
libraries such as Colt, I have no choice. But in general? What do you
think?
On Oct 25, 5:3
Hi,
On Oct 26, 2:35 pm, Gorsal wrote:
> Im attempting to create a named class inside another namespace like
> this:
>
> (ns ide.handlers
> (:import [org.eclipse.ui.commands AbstractHandler]))
>
> (defmacro new-handler-class [n event & body]
> `(do
> (ns ~n
> (:gen-class :extend
You can probably settle for a set of Java data structures that are
inter-operable with Clojure.
1. Use interfaces (because Clojure implements them too) such as
java.util.List, java.util.Set, java.util.Map etc.
2. Use type hints and enable "warn on reflection".
3. When in Clojure, first convert to
> For example, the macro '->' changes this:
>
> (-> x (foo y) (bar z))
>
> Into this:
>
> (foo (bar x z) y)
Small correction. The result above should be:
(bar (foo x y) z)
user=> (macroexpand '(-> x (foo y) (bar z)))
(bar (clojure.core/-> x (foo y)) z)
Perry
--~--~-~--~~
Dear all,
I've got a re-implementation of the for-macro sitting around here that
removes this limitation (and others, the vector can't be empty either,
if I remember correctly). The implementation also adds the sorting and
grouping functionality described in Wadler and Jones' paper
"comprehensive
I just realize i wasn't putting those functions in an ns . So
(defmacro new-handler-class [n event & body]
`(do
(ns ~n
(:gen-class :extends
~'org.eclipse.ui.commands.AbstractHandler :init ~'init))
(binding [*ns* (find-ns '~n)]
(defn ~'-init [] [[][]])
(defn ~
Im attempting to create a named class inside another namespace like
this:
(ns ide.handlers
(:import [org.eclipse.ui.commands AbstractHandler]))
(defmacro new-handler-class [n event & body]
`(do
(ns ~n
(:gen-class :extends
~'org.eclipse.ui.commands.AbstractHandler :init ~'init))
On Oct 25, 11:56 pm, MarkSwanson wrote:
> I'd like to run
> count-nodes against a compiled fn that I've previously defined, but I
> could not get an existing fn into quoted form
Can't be done. Once a fn is compiled, it's just Java bytecode.
-SS
--~--~-~--~~~---~--~-
On Oct 23, 2:16 pm, Baishampayan Ghose wrote:
> Is there any way to use duck-streams to write data as binary?
No, duck-streams only does text. For binary I/O, you need the
InputStream and OutputStream classes.
-SS
--~--~-~--~~~---~--~~
You received this message
On Mon, Oct 26, 2009 at 8:01 AM, Gorsal wrote:
> Thanks. Now i know to also use doc :)
You're welcome.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
Thanks. Now i know to also use doc :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - plea
On Mon, Oct 26, 2009 at 4:18 AM, Cristian wrote:
> I just started learning clojure and I tried to extend JButton, but I
> keep getting a ClassFormatError when I try to instantiate the class.
>
> The problem started happening when I declared my own constructors. Can
> I not declare a constructor wi
On Sun, Oct 25, 2009 at 6:28 PM, Rich Hickey wrote:
>
> On Sun, Oct 25, 2009 at 12:16 AM, Michel Salim
> wrote:
>>
>> Jim was working on logic programming in Clojure up to a few months
>> ago, and it seems as if the concern was that the code was too
>> derivative.
>>
>> I have recently made avai
I just started learning clojure and I tried to extend JButton, but I
keep getting a ClassFormatError when I try to instantiate the class.
The problem started happening when I declared my own constructors. Can
I not declare a constructor with no arguments? Here's my test code.
(ns test.gui.button
Hi
thanks for the replies :)
The whole system consists of a couple of hundreds of thousands lines
of Java code. The part i am investigating is a validation sub system
that validates a number of input parameters given from the user
against various predefined values and rules, and against databases
Hi,
On Oct 26, 7:08 am, John Harrop wrote:
> > (count-nodes "abcde")
> > ; 6
>
> Yikes.
>
> Maybe special-casing strings would be best: change (seqable? x) into (and
> (seqable? x) (not (string? x))). I don't know if Seqable is synonymous with
> that; might there be other seqable?s that
Hi,
On Oct 26, 3:58 am, samppi wrote:
> I've read many, many times that binding allows you to give to vars
> "thread-specific values", and that vars have a "thread-global value"
> too. I think that I understand how vars and binding work, but I don't
> understand how binding is necessarily relat
On Oct 25, 8:39 pm, Jarkko Oranen wrote:
> Nitpick, but... The function closest to ruby's eval would be 'eval'.
This is true, but doesn't mean what I said isn't true also. The
closest thing to Ruby's eval is the Clojure eval function, and the
closest thing to Clojure's macros in Ruby is eval. A
35 matches
Mail list logo