Re: Make a loop in a loop

2010-07-07 Thread Dave M
On Jul 7, 5:06 pm, Isak Hansen wrote: > On Wed, Jul 7, 2010 at 5:00 PM, Lars Nilsson wrote: > > > Maybe > > > (doseq [year (range 1999 2010 1)] > >  (doseq [month (range 1 53 1)] > >    (print-data year range))) > > You could also do this with dotimes instead of doseq. Doesn't matter > for Ns thi

Re: Translation from Common Lisp 2

2010-03-18 Thread Dave M
... > (game-action weld chain bucket attic >          (if ((and (have 'bucket) (alter-var-root (var *chain-welded*) (fn ^ Your if-condition is nested one form too deeply; try "(if (and (have 'bucket) ...) ...)" I haven't tried it, so there might be other problems. -Dave -- You

Re: Is str supposed to be able to output lazy strings?

2009-12-06 Thread Dave M
On Dec 6, 1:20 pm, CuppoJava wrote: > This is expected behavior. > > eg. (str (map identity [1 2 3])) > returns "clojure.lang.lazy...@7861" > > The way to think about it is, (str) asks for the string representation > of an object. The string representation of a lazy sequence in this > case is "cl

Re: Java Class Factory

2009-12-02 Thread Dave M
On Dec 2, 11:15 pm, lazy1 wrote: > Hello, > > I'm trying to create a "factory" method for Java classes, however I'm > doing something wrong. > > (import '(java.util Dictionary HashMap)) > > (def *containers* { :dict Dictionary :hash HashMap}) > (defn new-container >   [type] >   (new (*container

Re: Space usage of lazy seqs

2009-12-02 Thread Dave M
On Dec 2, 9:09 pm, David Brown wrote: ... > If you're running JDK 6, you can run the virtualvm, or jconsole to get > a better handle on the memory usage, and even dig into what it might > used for. Google does not return useful references to a tool called virtualvm; perhaps you mean VisualVM (j