On 8 Mar 2010, at 19:22, Jonathan Shore wrote:
For the sake of understanding, I'm not yet clear on how one
*efficiently* binds multiple "pieces" of state together in
clojure. How would one create a simple matrix for example where I
want to bind dimension and a float-array into a tightly b
Hi,
On Mar 8, 2:59 pm, Luka wrote:
> (defn leafs [m]
> (loop [vs (vals m), accum []]
> (if (empty? vs)
> accum
> (let [v (first vs)]
> (if (map? v)
> (recur (rest vs) (into accum (leafs v)))
> (recur (rest vs) (conj accum v)))
How about this?
(
Woops. And of course there should be the check for bound in the update
functions of the lru and mu strategies...
(defn lru-cache-strategy
"Implements LRU cache strategy for memoize. At most bound number of
argument lists are kept in the cache. They are dropped in LRU
order."
[bound]
(let [
On 09.03.2010, at 14:28, Jonathan Shore wrote:
> Thanks. BTW, you may want to consider targeting ejml instead of colt if you
> are targeting dense matrix operations. ejml does quite a bit better
> performance-wise. Colt does support more matrix types though.
Thanks for the pointer, I didn
Which is preferable depends on the nature of the changes that your
matrices will undergo. For dense linear algebra, it's common for most
of a matrix to change with every operation. Hence you won't reap any
benefits from the persistence of Clojure's maps.
The problem with your first implementation
Hi, I actually wrote a sort of counterpart to leafs a while back:
(defn- rmap
"Implementation core for map-at-levels."
[func obj lvls lvl]
(let [children-mapped (if (coll? obj)
(for [c obj]
(rmap func c lvls (inc lvl)))
Thank you.
They seem to use java to generate (with GWT) both client-side html and
javascript, and server-side REPL. Nice approach.
I'm looking forward to the day when one will be able to do all that
only with clojure :) We already have a nice clojrue web frameworks, so
the only thing that is miss
Hi. I am completely new to clojure - my 3rd day or so. Need to go buy
a book on the subject. So please help me with a couple of things:
Item 1) I have two calls to count. One works, and the other does not.
; counts number of items in collection
user=> (count (list 1 2 3 4 "er" 34) )
6
; count do
Thanks. BTW, you may want to consider targeting ejml instead of colt if you
are targeting dense matrix operations. ejml does quite a bit better
performance-wise. Colt does support more matrix types though.
On Mar 9, 2010, at 3:00 AM, Konrad Hinsen wrote:
> On 8 Mar 2010, at 19:22, Jonatha
Thanks
The use of (int ...) works, avoiding the dispatch, but it has to be
used everywhere there is a variable or literal. Starts getting very
ugly and unreadable as expressions get longer.Is there any way to
indicate an "int" or "double" literal short of (int 2). Here is the
modified func
Hi,
On Tue, Mar 9, 2010 at 22:55, Meikel Brandmeyer wrote:
> On Mar 9, 3:49 pm, Mike Mazur wrote:
>
>> I tried to compile Vimclojure with clojure-1.2.0-SNAPSHOT, but the
>> latest release fails to compile with a NoSuchMethodError.
>
> Can you be more specific on the failure? What method is tried
Hi,
I wanted to play with Stuart Sierra's lazytest[1] using Vimclojure.
lazytest depends on clojure-1.2.0-SNAPSHOT (so it says in pom.xml),
and my Vimclojure (compiled against an older clojure version) doesn't
work when launched with clojure-1.2.0-SNAPSHOT on the classpath.
I tried to compile Vim
Thank you, Meikel and Christian!
- Srini
On Mar 9, 7:43 am, Christian Vest Hansen wrote:
> On Tue, Mar 9, 2010 at 6:26 AM, Srini wrote:
> > Hi. I am completely new to clojure - my 3rd day or so. Need to go buy
> > a book on the subject. So please help me with a couple of things:
>
> > Item 1) I
Hello,
It seems it's not possible to use the clojure.core/compare function
with persitent lists :
(compare '(1 2) '(3 4))
gives the following error "clojure.lang.PersistentList cannot be cast
to java.lang.Comparable"
Why don't PersistentLists implement Comparable?
It works without problems for
Hi,
On Mar 9, 3:49 pm, Mike Mazur wrote:
> I tried to compile Vimclojure with clojure-1.2.0-SNAPSHOT, but the
> latest release fails to compile with a NoSuchMethodError.
Can you be more specific on the failure? What method is tried to be
called on which object?
I have VC running on all clojure
On Mar 9, 2010, at 1:28 AM, Per Vognsen wrote:
> Which is preferable depends on the nature of the changes that your
> matrices will undergo. For dense linear algebra, it's common for most
> of a matrix to change with every operation. Hence you won't reap any
> benefits from the persistence of Clo
On Tue, Mar 9, 2010 at 1:44 AM, Timothy Pratley
wrote:
> On 9 March 2010 04:03, Jonathan Shore wrote:
>> (defn fib [#^Integer a]
>> (if (< a 2)
>> a
>> (+ (fib (- a 1)) (fib (- a 2)
>> I'm just learning, so I may have overlooked something that mitigates or
>> otherwise avoids dispat
On Mar 9, 8:59 am, jshore wrote:
> I suspect that on recursion a will become an object again and will
> then need to be downcasted again as well. Would be nice to be able
> to do:
>
> (defn fib [#^int v]
> (if (< v 2)
> v
> (+ (fib (- v 1)) (fib (- v 2
On Tue, Mar 9, 2010 at 6:26 AM, Srini wrote:
> Hi. I am completely new to clojure - my 3rd day or so. Need to go buy
> a book on the subject. So please help me with a couple of things:
>
> Item 1) I have two calls to count. One works, and the other does not.
>
> ; counts number of items in collect
On 9 March 2010 15:59, jshore wrote:
[...]
> (defn fib [a]
> (let [v (int a)]
> (if (< v (int 2))
> v
> (+ (fib (- v (int 1))) (fib (- v (int 2)))
>
> I suspect that on recursion a will become an object again and will
> then n
Hi,
On Mar 9, 6:26 am, Srini wrote:
> ; count does not work. I get an exception. Need to figure out what I
> am doing wrong here.
> user=> (count (list 23 "3er" oel" 5) )
^^ unbalanced string
> ; could not get it to work for lists. apparently works only for
>
Hi All,
Can anyone explain how I can get a traditional Mac OS menubar to
appear at the top of the screen?
Normally I would use (System/setProperty
"apple.laf.useScreenMenuBar", "true") and then
(.setJMenuBar ...) in my main frame.
This does not appear to work. The menu shows up in the frame i
It looks like the new (deftype ..) may be what I am looking for in
terms of binding heterogenous state efficiently. The matrix function
was just a test case for how to bind state efficiently. Thanks for
all of the responses.
On Mar 8, 2:57 pm, Jonathan Shore wrote:
> Hi,
>
> I'm still trying
Hmm, is there a notation to express an int literal. Better yet,
clojure should try to infer that if I do (+ v 2) where v was hinted to
be "int", 2 should be considered to be an int. The code starts
getting really messy:
(defn fib [a]
(let [v (int a)]
(if (< v (int 2))
By the way, I also noticed your logic is wrong. It should be (+ (* i
ncol) j) rather than (* i j).
-Per
On Tue, Mar 9, 2010 at 2:57 AM, Jonathan Shore wrote:
> Hi,
> I'm still trying to work out the best way to deal with operations on
> heterogenous data in clojure. I have a complex applicatio
On Mar 9, 2010, at 2:41 AM, Per Vognsen wrote:
> By the way, I also noticed your logic is wrong. It should be (+ (* i
> ncol) j) rather than (* i j).
>
> -Per
Thanks -- I was just trying to explore how to deal with heterogeneous data.
No plans to build my own matrix lib. Thanks for spotti
Hi again,
On Mar 9, 8:51 am, Meikel Brandmeyer wrote:
> (dissoc cache args))
And of course this is also wrong. Bleh. I will clean this up and do a
short blog post this evening...
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure
On 8 Mar 2010, at 13:59, Luka wrote:
> Other thing I would like to ask is how can I see what is different in
> 40 github clones of clojure.contrib without clicking on every clone?
Either:
1. Use the github network browser:
http://github.com/richhickey/clojure-contrib/network
(use left/ri
On Mar 9, 12:09 am, Meikel Brandmeyer wrote:
> How about this?
>
> (defn leafs
> ...
This should be leaves, not leafs, right? Another one of those weird
irregular English plurals.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this gro
On Mar 8, 11:50 am, Jonathan Shore wrote:
> How would I encapsulate this into a data structure to be passed into
> functions efficiently? I could use a map of symbols to various structures,
> but that would be inefficient in access and memory. I could bind into a
> closure but then how do
On Mar 8, 8:22 pm, Jonathan Shore wrote:
> It is a shame to have to dive down to Java or native (perhaps with the
> exception of some of the massive numerical libraries one does not want to
> rewrite). I'm hoping to use Clojure or something like clojure as a complete
> replacement.
Shame? Isn'
Is it possible to write a plug-in in Clojure CLR? And if it is, would
you prefer it in Clojure CLR or C# is fine? Also do you want both REPL
and syntax highlighting for clj files in Visual Studio?
Thanks,
Manoj.
On Mar 8, 2:17 pm, Eric Thorsen wrote:
> Is there/is anyone working on/is anyone int
I suspect that on recursion
If you use plain function-calling recursion, yes. If you use (loop ...
recur...) then (IIRC) locals are not boxed (as well as saving stack).
Also bear in mind that JIT will come into play here; after a few tens
of thousands of arithmetic ops, the common path wil
On Mar 9, 2010, at 1:19 PM, Richard Newman wrote:
>> I suspect that on recursion
>
> If you use plain function-calling recursion, yes. If you use (loop ...
> recur...) then (IIRC) locals are not boxed (as well as saving stack).
>
> Also bear in mind that JIT will come into play here; after a f
Forgot to ask the below mentioned questions earlier -
Which version of Visual Studio are you targeting - 2008 or 2010?
Do you have a development road-map for your plug-in features?
Thanks,
Manoj.
On Mar 9, 1:05 pm, mmwaikar wrote:
> Is it possible to write a plug-in in Clojure CLR? And if it is
My recollection is that when I posted this question several months ago,
Rich's response was that there was no particular reason that PersistentLists
don't implement Comparable, other than that it hadn't been done yet. So I
assume a patch is welcome on this, but no one has stepped forward to do it
Running late for work, but quickly, the plugin searches for namespaces
and generates a run-test.clj file looking like:
http://gist.github.com/326972
which is run. Interesting, just looking at that I see for some reason
"(require 'clojure.contrib.test-macro-utils)" is duplicated (and also
duplica
I totally agree, having different eviction strategies would be great
and having memoizers with max capacities in clojure.contrib would
probably be useful to a lot of developers.
Also, a memory sensitive memoizer (using soft references?) would be
nice. :)
On Mar 9, 4:51 pm, Meikel Brandmeyer wrot
On Mar 8, 2010, at 1:06 PM, Nurullah Akkaya wrote:
> Using this,
>
> http://paste.lisp.org/display/67182
>
> would allow you to do,
>
> (let [config {:str "fred" :beg 2 :end 3}]
> (apply (jfn 'substring) (map config [:str :beg :end])))
That's quite nice. Thanks!
--
You received this message
On Mar 8, 2010, at 11:20 PM, Michał Marczyk wrote:
> It's simple to write this way... And if you provide type hints, I'd
> expect the resulting function to be quite performant. If you don't
> care about that, here's a flexible alternative using eval:
>
> user> (defmacro methodfn [name]
>`
I searched the archives and google but cannot find an example.
How do I call main?
packge thefoo;
public class Foo {
public static void main(String[] args) {
System.out.println(args[0]);
}
}
I tried
(import '(thefoo Foo))
(. Foo (thefoo/main ["test"]))
java.lang.ClassCastException: cloj
On Mar 9, 2:57 pm, WoodHacker wrote:
> Hi All,
>
> Can anyone explain how I can get a traditional Mac OS menubar to
> appear at the top of the screen?
>
> Normally I would use (System/setProperty
> "apple.laf.useScreenMenuBar", "true") and then
> (.setJMenuBar ...) in my main frame.
>
> This does
You need to turn that argument into a genuine Java array like so:
(Foo/main (into-array ["yay"]))
On Tue, Mar 9, 2010 at 1:15 PM, TimDaly wrote:
> I searched the archives and google but cannot find an example.
> How do I call main?
>
> packge thefoo;
>
> public class Foo {
> public static voi
On 9 March 2010 08:09, Meikel Brandmeyer wrote:
> Hi,
>
> On Mar 8, 2:59 pm, Luka wrote:
>
>> (defn leafs [m]
>> (loop [vs (vals m), accum []]
>> (if (empty? vs)
>> accum
>> (let [v (first vs)]
>> (if (map? v)
>> (recur (rest vs) (into accum (leafs v)))
>>
On Sun, Mar 7, 2010 at 6:44 PM, strattonbrazil wrote:
> I am on Linux. I have a 6.6 and a 6.8 directory in my .netbeans
> folder. 6.6 still runs. I have tried moving individual jars in and
> out of that dir, but I still get the error. I even moved the entire
> 6.8 dir and still get the same me
As threatened here a writeup. For this thread the Summary section is
probably most interesting.
http://kotka.de/blog/2010/03/The_Rule_of_Three.html#summary
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send
By listing the code above you've shown why the default must be so,
since calling your function with any of those types will "just
work" (at least before an stack overflow), which of course can't be
done with primitive types. For an untyped language with a worry-free
numeric abstraction, this seems
On 9 March 2010 23:17, Meikel Brandmeyer wrote:
> As threatened here a writeup. For this thread the Summary section is
> probably most interesting.
>
> http://kotka.de/blog/2010/03/The_Rule_of_Three.html#summary
>
> Sincerely
> Meikel
In the way of early feedback -- that's looks super neat! I've
On 9 March 2010 22:58, Rick Moynihan wrote:
> There a parity between this and clojure.contrib.seq-utils/flatten
> (which doesn't work with maps)... So how about this lazy non stack
> consuming alternative?
>
> (defn leaves [m]
> (filter
> (complement map?)
> (rest (tree-seq map? #(vals %)
>
Hello,
I maintain a (free) listing of Lisp and Clojure jobs at
lispjobs.wordpress.com
If you have a Clojure job you'd like to advertise, please send it to
one of the addresses found on the About page:
http://lispjobs.wordpress.com/about/
Will Fitzgerald
--
You received this message because yo
Hello,
On Tue, Mar 09, 2010 at 01:15:28PM -0800, TimDaly wrote:
> I searched the archives and google but cannot find an example.
> How do I call main?
>
> packge thefoo;
>
> public class Foo {
> public static void main(String[] args) {
> System.out.println(args[0]);
> }
> }
>
> I tried
In PAIP section 2.3, Norvig gives an example of a generative grammar:
;; common lisp
(defparameter *simple-grammar*
'((sentence -> (noun-phrase verb-phrase))
(noun-phrase -> (Article Noun))
(verb-phrase -> (Verb noun-phrase))
(Article -> the a)
(Noun -> man ball woman table)
Hi,
On Mar 10, 6:47 am, Mike K wrote:
> (defparameter *simple-grammar*
> '((sentence -> (noun-phrase verb-phrase))
> (noun-phrase -> (Article Noun))
> (verb-phrase -> (Verb noun-phrase))
> (Article -> the a)
> (Noun -> man ball woman table)
> (Verb -> hit took saw liked))
>
53 matches
Mail list logo