Hi Mark,
Am 10.05.2009 um 07:00 schrieb Mark Reid:
So the extra parentheses are there to force the evaluation of the
predicate and function?
Well. The don't "force" the evaluation. They just call the provided
function. "pred" evaluates to a function. In our example #(.ready
reader).
"(pred)
Hi Laurent,
Am 10.05.2009 um 07:19 schrieb Laurent PETIT:
No problem, but you can still consider (for the definition of the
function) the equivalent higher-order version I provided later in
the my post (you didn't answer to this one):
(defn repeatedly-while [no-arg-pred f]
(take-while (f
2009/5/10 Mark Reid
>
> Hi Laurent,
>
> On May 10, 5:15 am, Laurent PETIT wrote:
> > So if you want to call it with a no-arg "predicate", you must adapt it :
> >
> > (repeatedly-while (fn [ _ ] (no-arg-pred)) f)
> > instead of
> > (repeatedly-while no-arg-pred f)
>
> I think that this is too con
2009/5/10 Laurent PETIT
> 2009/5/9 Stefan Hübner
>
>>
>> On 8 Mai, 01:39, Laurent PETIT wrote:
>> > note that clojure must be compatible with JDK 1.5, so if you compile
>> with
>> > 1.6, maybe you should verify the compatibility mode (not sure if what I
>> > write here makes sense, I'm not a sp
Hi Laurent,
On May 10, 5:15 am, Laurent PETIT wrote:
> So if you want to call it with a no-arg "predicate", you must adapt it :
>
> (repeatedly-while (fn [ _ ] (no-arg-pred)) f)
> instead of
> (repeatedly-while no-arg-pred f)
I think that this is too convoluted a calling pattern. For my
purpose
Hi Meikel,
On May 10, 3:05 am, Meikel Brandmeyer wrote:
> There is a mistake in this function: pred should be (pred)
> as well as f should be (f).
> Furthermore I would call it repeatedly-while.
>
> (defn repeatedly-while
> [pref f]
> (lazy-seq
> (when (pred)
> (cons (f) (cons
2009/5/9 Stefan Hübner
>
> On 8 Mai, 01:39, Laurent PETIT wrote:
> > note that clojure must be compatible with JDK 1.5, so if you compile with
> > 1.6, maybe you should verify the compatibility mode (not sure if what I
> > write here makes sense, I'm not a specialist in javac retrocompatibility
On May 10, 12:37 am, David Nolen wrote:
> Cool, I couldn't get this to work, I get an exception like the following:
> Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
> wrong number of arguments
Is this with gears.clj? Could you post a full backtrace and relevant
softwa
The pretty-printer requires clojure-contrib to be compiled with "ant -
Dclojure.jar=..." You may be missing that.
-SS
On May 9, 8:25 pm, Aaron Feng wrote:
> When I tried to import PrettyWriter from clojure-contrib I'm getting
> java.lang.ClassNotFoundException. Am I missing something?
> Thanks
(set! *warn-on-reflection* true)
(defn byte-array-sound [frequency sample-rate nb-frame]
(let [sample-array (make-array (. Byte TYPE) (* nb-frame 2))
sample-interval (/ (float frequency) (float sample-rate))
limit (alength sample-array)]
(loop [sample-index 0
impulse-train (float 0)]
One comment, although this has no effect on performance: you don't
need to use the static class fields as functions. That is, you can
write Math/PI and Short/MAX_VALUE instead of (Math/PI) and (Short/
MAX_VALUE).
-Stuart Sierra
On May 9, 6:53 pm, Julien wrote:
> I'm interested to do audio syn
When I tried to import PrettyWriter from clojure-contrib I'm getting
java.lang.ClassNotFoundException. Am I missing something?
Thanks,
Aaron
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post t
What's a sample set of values you would pass to this function?
On Sat, May 9, 2009 at 7:35 PM, Julien wrote:
>
>
> > Out of curiosity, how long does that function take to execute in Java?
>
> The java version is much faster even with much more work to do, which
> put me perplex.
> I didn't check
Cool, I couldn't get this to work, I get an exception like the following:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
wrong number of arguments
The original version works alright for me.
Also you should organize the library folder in the standard way so that your
li
> Out of curiosity, how long does that function take to execute in Java?
The java version is much faster even with much more work to do, which
put me perplex.
I didn't check how much it takes, must be about 100ms.
Thx for the tips, though that doesn't really improve anything.
My guess is that i
Also type hinting your math ops like mad on tight loops helps:
;; ~20ms
(time (dotimes [x 100]
(* (float 1.0) (* (float 2.0) (float 3.0)
;; ~65ms
(time (dotimes [x 100]
(* 1.0 (* 2.0 3.0
Another 3x increase.
On May 9, 6:53 pm, Julien wrote:
> I'm interested to
I would set your *warn-on-reflection* flag of course to see if you're
missing out on any type hinting. Also watch out for math ops that involve
more than 2 arguments:
;; takes ~400ms on my machine
(time (dotimes [x 100]
(* 1 2 3)))
;; takes ~50ms on my machine
(time (dotimes [x 100]
(* 1
I'm interested to do audio synthesis and eventually audio DSP on the
JVM using the Java sound API and I think that it could be fun to do
that following the functional programming paradigm.
I don't intend to build a huge library but just to try some experiment
on my own to better understand how dig
Well the solution in my case was to create a map from visited types to
visited members (http://tinyurl.com/poq5e2) the visitation logic uses
this map in order to invoke the next visit (http://tinyurl.com/
pkugra).
This "pattern" enables visitors to be implemented in Clojure for pure
Java based fr
> The problem (such as it is) with these solutions is that you still need
> to do something to attach to a repl. A repl is a requirement for us.
I've done the screen thing in the past. It works fine, though I have
(very rarely) encountered issues with screen locking up or dying a few
times over
On 8 Mai, 01:39, Laurent PETIT wrote:
> note that clojure must be compatible with JDK 1.5, so if you compile with
> 1.6, maybe you should verify the compatibility mode (not sure if what I
> write here makes sense, I'm not a specialist in javac retrocompatibility
> concerns).
Thanks for the tip!
On 9 Mai, 17:08, Howard Lewis Ship wrote:
> clojure-lang because there will be a clojure-contrib artifact for the
> same group.
It didn't occur to me yet, that having clojure-contrib in the same
group would render "org.clojure:clojure" a bad choice as
groupId:artifactId for clojure itself. Does
It's essentially a thin wrapper on JOGL, but I intend to improve the
interface in future.
http://github.com/ChickenProp/cloggle/tree/master
Clojure, the JVM and opengl are all fairly new to me, so I'd
appreciate feedback about my coding style, potential pitfalls, and
anything else you can think
Hi, the version of repeatedly-while I submitted still takes an argument for
the predicate function, that would be the value of the last generated item
in the list:
(defn repeatedly-while
[pred f]
(take-while pred (repeatedly f)))
So if you want to call it with a no-arg "predicate", you must ada
Wow, I've never seen ~' before. But it works great. Thanks a lot.
On May 9, 5:41 am, Konrad Hinsen wrote:
> On 09.05.2009, at 03:50, samppi wrote:
>
> > I'm trying to use m-plus inside a macro like this:
>
> > (defmacro alt
> > [& subrules]
> > (with-monad parser-m
> > `(fn [stat
Thanks Adrian,
I have looked at the clojure.set library, but haven't thought about it
significantly with respect to the matrix library. Thanks for the
heads up.
-Adler
On May 6, 11:17 pm, Adrian Cuthbertson
wrote:
> If you haven't seen it yet, the set module (clojure.set) provides a
> basic i
Hey Anand,
Thanks for the feedback!
I would have liked to call the arrays "arrays" but java's arrays make
that name less than ideal. If people think a better name for the
library is persistentarray, I'm not opposed to changing (especially
this early in the game).
It shouldn't be a problem to m
Thank you Rich for answering, I appreciate your expertise.
> It's always best to post a complete example - it makes it easier for
> people to help you, e.g. ";audioFormat is defined above" just leaves
> me having to figure out how to make one in order to reproduce your
> problem.
> Use of camelCa
Hi,
Am 09.05.2009 um 13:06 schrieb Mark Reid:
; Begin lazyread.clj
(import '(java.io FileReader BufferedReader PrintWriter))
(def filename "test.data")
; Write out a small test file. Numbers 0 to 99, one per line.
(with-open [data (PrintWriter. filename)]
(dotimes [i 100] (.println
On May 9, 11:58 am, Julien wrote:
> Hello all,
>
> A quick newbie question about getting hold of an object implementing
> interface from the Java sound API.
> The static method AudioSystem/getSourceDataLine returns an object
> implementing the SourceDataLine interface.
> But the returned object
On May 8, 7:17 pm, André Thieme wrote:
> In principle you could run Clojure and ABCL inside the same VM.
> http://common-lisp.net/project/armedbear/
That sounds like a nightmare. You still couldn't call a CL function
directly from Clojure without some Java in between.
-Stuart Sierra
--~--~--
On May 8, 6:30 pm, Chris Dean wrote:
> How do folks launch their apps?
Shell scripts, calling AOT-compiled classes (gen-class with a -main
function).
-Stuart Sierra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
Hello all,
A quick newbie question about getting hold of an object implementing
interface from the Java sound API.
The static method AudioSystem/getSourceDataLine returns an object
implementing the SourceDataLine interface.
But the returned object in clojure doesn't seem to fully implement the
i
clojure-lang because there will be a clojure-contrib artifact for the
same group.
On Thu, May 7, 2009 at 7:28 AM, Stefan Hübner wrote:
>
> Laurent PETIT writes:
>
>> Seems fine to me.
>>
>> One question, though: I see that you want to name the artifact
>> "clojure-lang" and not just "clojure".
I'm completely engulfed in all this material, but I wanted to come
back and say that I'm stunned by the enthusiasm with which you share
your knowledge here. Many thanks, again.
Dirk
Parth Malwankar schrieb:
> On Fri, 08 May 2009 22:20:13 +0530, dhs827 wrote:
>
> >
>
> >
> > ; First thing to le
+1
On May 9, 2:33 am, Mark Derricutt wrote:
> Hi,
>
> Can we add the following to contrib's sql namespace, it simply adds "jndi"
> as a db-spec scheme ( I also raised this
> ashttp://code.google.com/p/clojure-contrib/issues/detail?id=39, which google
> decided to set as a defect and I can't cha
On 09.05.2009, at 03:50, samppi wrote:
> I'm trying to use m-plus inside a macro like this:
>
> (defmacro alt
> [& subrules]
> (with-monad parser-m
> `(fn [state#]
> ((m-plus ~...@subrules) state#
>
> Unfortunately, I get the error:
> No such var: my-namespace.fnpar
Hi Laurent,
Thanks for the feedback. I'm still a bit stuck though since neither my
proposal nor yours work for the type of application I had in mind.
Here's a complete program which highlights the problems:
; Begin lazyread.clj
(import '(java.io FileReader BufferedReader PrintWriter))
> From what you say I imagine you have something like a matrix
> or table, something with rows and columns that form cells.
> And you want to be able to grab the contents of one cell and move
> it around to another cell.
Andre, that statement captures all I intend to achieve.
This is what I wanted
Chris Dean wrote:
> For now I'm using hand written scripts that launch under screen. And
> that works for us.
Would be great if you share those scripts with us.
Regards,
BG
--
Baishampayan Ghose
oCricket.com
signature.asc
Description: OpenPGP digital signature
Adrian Cuthbertson writes:
> For production server systems running under Linux, I've used apache
> commons daemon to get java apps launched
Thanks for the info.
The problem (such as it is) with these solutions is that you still need
to do something to attach to a repl. A repl is a requiremen
41 matches
Mail list logo