Re: regex literal syntax

2008-10-09 Thread Brian Watkins
Yes, dealing with multiple escaped escape sequences is a weak point of handling regexs. To really integrate them into the language, and that integration is essential to success, they must be typed straight into the code literally without baggage. As much as flexibility and simplicity, the easy a

Writing conditions on geometric coordinates

2011-05-28 Thread Brian Watkins
I often write code that deals with geometric coordinates and similar ordered n-tuples on homogenous bases. Lots of times I face the situation where I want to write a condition that says, "if these two regions overlap, then do something," or "if this function is satisfied over an axis ax+by=c or ov

Interrupting the Repl

2010-04-15 Thread Brian Watkins
Is there a way to interrupt the Repl when I've set to some kind of infinite loop without also shutting down the JVM entirely? -- 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

Primitive arithmetic and mod

2010-05-02 Thread Brian Watkins
I'm trying to speed up computing terms of a simple recurrence where the terms are computed modulo some value each iteration, (defn NF-mod-limit [p q limit] (loop [n 0, nf 0, z 0, S 290797] (if (= n (inc q)) nf (recur (inc n) (mod (+ nf (* (mod S p) z)) limit)

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
Any ideas about this? On May 2, 1:44 am, Brian Watkins wrote: > I'm trying to speed up computing terms of a simple recurrence where > the terms are computed modulo some value each iteration, > > (defn NF-mod-limit [p q limit] >  (loop [n 0, nf 0, z 0, S 290797] >    

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
ll try rem for time but I see that I still have to cast to long; Clojure doesn't think (rem (long ) (long x)) is a long. The error is "recur arg for primitive local: nf must be matching primitive." On May 3, 6:53 pm, David Nolen wrote: > On Mon, May 3, 2010 at 4:21 PM, B

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
gt;         nf >         (recur >           (inc n) >           (unchecked-remainder >             (+ nf (* (unchecked-remainder S p) z)) >             limit) >           (unchecked-remainder (inc (* p z)) limit) >           (unchecked-remainder (* S S) (long 50515093))) >

Getting line numbers in stack traces

2010-05-13 Thread Brian Watkins
What is the method that gets line numbers and function names into stack traces? I know I can't get them in the Repl (because there aren't any), but I tried loading my file with load-file and that doesn't help either. -- You received this message because you are subscribed to the Google Groups "C

Re: Getting line numbers in stack traces

2010-05-13 Thread Brian Watkins
e can't have a context and line numbers attached, is it just impossible to have meaningful debugging and stack traces? On May 13, 12:05 pm, MarkSwanson wrote: > On May 13, 6:11 am, Brian Watkins wrote: > > > What is the method that gets line numbers and function names into > &g