These behave differently in 1.6 with respect to printing the empty list:
(clojure.pprint/print-table (list {:a 1 :b 2 :c '()}))
| :a | :b | :c |
|++-|
| 1 | 2 | clojure.lang.PersistentList$EmptyList@1 |
(cloju
Puzzler, thanks for all your excellent ideas!
I get the impression that you're as troubled as I am by the brokenness of
recursion, but it looks like it can be worked around.
A bit of memory thrown at the JVM stack combined with a better memoization
technique should work in most of the cases tha
Jim, increasing the stack size solved the problem in so far as it allowed
the code to run (I needed a tree depth of 2000), but then it just sat and
churned for hours and ran down the battery bank on my narrowboat, so I
killed it.
This morning I bit the bullet and got the clojure program to outp
C+1, James Reeves wrote:
>
> On 23 September 2013 00:28, John Lawrence Aspden
>
> > wrote:
>
>> Nice, but it won't work for me, since I'm trying to avoid computing all
>> the values in the table, and so I can't use the pump-priming approach. I
>>
the stack size should give
me as much recursion as a man could reasonably need.
John.
On Monday, September 23, 2013 2:13:12 PM UTC+1, Chris Perkins wrote:
>
> On Sunday, September 22, 2013 5:28:37 PM UTC-6, John Lawrence Aspden wrote:
>>
>> This recursion limit really is qu
Ah, it turns out that adding this
:jvm-opts ["-Xss50M"]
to project.clj
gets me about 25000 memoized self-calls, so that will do.
Last time I had to worry about stack size I was programming an 8051 . I'd
forgotten!
Cheers, John.
--
--
You received this message because you are subscribed
ck by
> running it in a bottom-up fashion a la traditional dynamic programming.
>
>
> On Sun, Sep 22, 2013 at 8:19 AM, John Lawrence Aspden <
> asp...@googlemail.com > wrote:
>
>> Hi Guys,
>>
>> I'm trying to memoize a fairly complicated double recursion
Hi Guys,
I'm trying to memoize a fairly complicated double recursion, and it's
blowing stack after not terribly many calls.
I've reduced the problem to a simple test case, summing from 1 to n :
user=> (clojure-version)
"1.5.1"
user=> (def gauss-recurse (fn [n] (if (< n 1) 0 (+ n (gauss-recurs
Hi,
Laziness makes my head hurt.
Is there any reason this is desirable behaviour?:
user=> (clojure-version)
"1.4.0"
user=> (reduce (fn [a b] (map + [1 1] a)) [1 1] (range 1000))
(1001 1001)
user=> (reduce (fn [a b] (map + [1 1] a)) [1 1] (range 1500))
StackOverflowError clojure.lang.Persiste
So, something like: (type 23) the reader makes a list of a symbol and a
primitive, the evaluator evals to get a generic function and a primitive,
then tries to apply the generic function to the primitive, can't find a
primitive version, so boxes the primitive to an object and tries again, and
t
Great, thanks!
So if one is an object and one is a primitive is one of these not true?
user=> (type seed1)
java.lang.Long
user=> (type 25214903917)
java.lang.Long
Cheers, John.
On Wednesday, February 20, 2013 11:44:44 PM UTC, Herwig Hochleitner wrote:
>
> I agree that unchecked-multiply
Hi, I'm getting an unexpected exception trying to do unchecked
arithmetic:
user=> (def seed1 25214903917)
#'user/seed1
user=> (type seed1)
java.lang.Long
user=> (type 25214903917)
java.lang.Long
user=> (unchecked-multiply seed1 0x5DEECE66D)
ArithmeticException integer overflow
clojure.lang.Numbers
Thanks Guys, I'll avoid the are macro.
Any ideas why this doesn't work?:
user=> (use 'clojure.test)
nil
user=> (use 'clojure.test.tap)
nil
user=> (deftest a (is true))
#'user/a
user=> (run-tests)
Testing user
Ran 1 tests containing 1 assertions.
0 failures, 0 errors.
{:type :summary, :pass 1, :
Hi, am I doing something wrong here?:
user=> (clojure-version)
"1.4.0"
user=> (use 'clojure.test)
nil
user=> (is ((fn[x] x) 1) 1)
1
user=> (are [ x y ] (= x y) ((fn[x] x) 1) 1)
StackOverflowError clojure.core/map/fn--4087 (core.clj:2426)
user=> (macroexpand '(are [ x y ] (= x y) ((fn[x] x) 1) 1
tfalls ahead?
Off to the various tutorials.
On 20/11/2012, John Gabriele wrote:
> On Tuesday, November 20, 2012 8:29:19 AM UTC-5, John Lawrence Aspden wrote:
>
>>
>> My intutition is telling me to use Python and Flask, but my heart is
>> telling me to use Clojure and some frame
gt;
> We (a team of 3) are currently building a production stack with Datomic and
>
> Noir. I listed SQL and Mongo just in case :-) Feel free to ask me more here
>
> or off-list if you like!
>
> On Tuesday, November 20, 2012 3:29:19 PM UTC+2, John Lawrence Aspden wrote:
>
Hi Guys,
I haven't used Clojure for a year or so (I was busy in C and Verilog),
but I still love it and would like to use it.
I'm going to write a web app. I want to ask users to answer multiple
choice questions and time their responses. I'd like them to be able to
easily make accounts (the sign-
Oops, sorry, I thought my post was stuck in the moderation queue and
have only just noticed the replies while browsing through the list
history! Thanks to everyone who replied.
Your version looks to be about six times faster than mine was. Thanks
ever so much!
In fact I wouldn't have noticed the d
Hi, the other day I was at a conference in London and learned Scala.
As my first program I translated a favourite fractal tree program
(which I stole from: http://marblemice.com/2009/04/26/clojure-fractal-tree/).
The programs are almost exactly the same in the two languages.
The Scala version see
19 matches
Mail list logo