Hi,
I am sorry if this has already discussed, but I didn't see it when I
did a search.
I keep running into instances where I would like to define a struct,
using defstruct, and then have that be applied to the elements of a
coll. A simple example might explain it better.
(defstruct mystruct
Hi,
we replaced a command line interface for an internal, mission-critical
application with a custom Clojure-REPL. It is used for administrative
tasks as well as testing.
Cheers,
Stefan
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
Hi,
On Wed, Nov 25, 2009 at 9:01 AM, cej38 junkerme...@gmail.com wrote:
Hi,
I am sorry if this has already discussed, but I didn't see it when I
did a search.
I keep running into instances where I would like to define a struct,
using defstruct, and then have that be applied to the
Wow! Many thanks for all the replies :-D
If there are any speech recognition enthusiasts out there, this code
is part of a Clojure example for Sphinx4.
http://cmusphinx.svn.sourceforge.net/viewvc/cmusphinx/trunk/sphinx4/src/scripts/clojure/ClojureTranscriber.clj?view=markup
Thanks Mike. No big hurry on my part - I'll look at the tutorial code.
On Nov 24, 4:39 pm, Mike Hinchey hinche...@gmail.com wrote:
You're right, the tests have not been converted to 3.2, so they are not
running at this time. The best thing to look at is the tutorial.clj - most
of these work
Hi all,
I'm new to Clojure and playing with small programs. Today I wrote a
snippet to figure out how future works:
(defn testf []
(let [f (future #(do
(Thread/sleep 5000)
%)
5)
g 7]
(+ g @f)))
(println (testf))
I'm
Hi Konrad,
In the original post, I put in the code, it was removed by the post
editor.
The way I wanted it implement, I have the main in java (gui and
stuff). I create a 3D array in java, it's an int array (i.e. int arr[]
[][] ) and call with that array to clojure.
It can be done in java at least
Hi,
On Nov 25, 9:01 am, cej38 junkerme...@gmail.com wrote:
Is there a better way of doing this? For example, something like:
(apply-struct-coll mystruct mycoll)
Close: (apply struct mystruct mycol)
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Here are my results.
The transient version performs slightly better on windows 32bit client
JVM, and considerably better on linux 64bit server JVM (they are both
1.06.0_17)
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
user= (import '(java.util.logging Logger Level))
nil
user= (def my-logger (Logger/getLogger mylogger))
#'user/my-logger
user= (. my-logger setLevel Level/WARNING)
nil
user= (. my-logger warning this is a warning)
Nov 25, 2009 5:38:25 AM sun.reflect.NativeMethodAccessorImpl invoke0
WARNING: this is
Hi Jim,
On Tue, Nov 24, 2009 at 11:21 PM, jim jim.d...@gmail.com wrote:
Evening all,
I've been working on a library for writing web applications for
compojure. I've got it written and (I think) working. First thing
tomorrow is to write a sample app and post it along with the library.
But
I am going through Programming Clojure and I recently downloaded the
code from the books official website. For other utils I can do, for
example, (require 'clojure.contrib.str-utils) and it works. But how do
I load code from the book? (require 'examples.introduction) throws the
following
I'm not quite sure what you're seeing. You might want to use the time
macro to help.
Here's what I was able to do:
user= (time ((fn [] (let [f (future (#(do (Thread/sleep 5000) %) 5))
g 7] (+ g @f)
Elapsed time: 4975.917889 msecs
12
Sean
On Nov 25, 12:04 am, Hong Jiang h...@hjiang.net
Graham,
That's exactly what it is. I used the continuation monad from
clojure.contrib.monads. After I get the code out, I'll be writing a
tutorial on how it works which will also explain the continuation
monad. I found that monad to be the most difficult to get my head
around, but it's hugely
On 25.11.2009, at 15:32, jim wrote:
That's exactly what it is. I used the continuation monad from
clojure.contrib.monads. After I get the code out, I'll be writing a
tutorial on how it works which will also explain the continuation
monad. I found that monad to be the most difficult to get my
I'm writing a crossword editor that provides a list of suggestions to
fill in the current word. This is displayed in a listbox to the right
of the grid, and every time the cursor is moved, I update it via
(def update-wlist #(let [w (take 26 (words-with (current-word)))]
(.
Yup, that's right - I filed ticket 130 to reflect this. If I get there
first, I'll mark the ticket as well and we can compare notes.
I'm super-excited about Leiningen, btw. I've been thinking about how
to turn my autodoc stuff into a Leiningen plugin so that we can get
easy doc for any project.
Read Christophe's post about multi-dim arrays. Reflection is getting in the
way here.
On Wed, Nov 25, 2009 at 2:55 AM, Amnon amnon.hei...@gmail.com wrote:
Hi Konrad,
In the original post, I put in the code, it was removed by the post
editor.
The way I wanted it implement, I have the main in
Bear in mind that when going from the slow to the fast, you not
only removed the repeated calls to to-array, but also removed the
overhead of words-with, since the lazy seq returned from the let
doesn't get fully realized.
Try changing your fast version to:
(def update-wlist #(let [w (doall
--
is still slow, but dropping down to
(def wlistdata (to-array (take 26 (words-with ...
(def update-wlist #(let [w (take 26 (words-with (current-word)))]
(. words setListData wlistdata)))
leaves everything running smoothly. Is there a more efficient
On Thu, Nov 26, 2009 at 12:31 AM, Jonathan Smith
jonathansmith...@gmail.com wrote:
I think a better way to do this is to not use a regex at all.
Canonically I think this sort of thing is (would be?) implemented by
constructing a 'sequence' of strings, (first filtered based on
potential word
On Nov 25, 11:09 am, Martin DeMello martindeme...@gmail.com wrote:
On Thu, Nov 26, 2009 at 12:31 AM, Jonathan Smith
To display you would want to use 'into-array' and your 'setListData'
function, because you seem to have a homogeneous collection of
strings; while to-array makes you an array
On Nov 25, 2:09 pm, Martin DeMello martindeme...@gmail.com wrote:
On Thu, Nov 26, 2009 at 12:31 AM, Jonathan Smith
jonathansmith...@gmail.com wrote:
I think a better way to do this is to not use a regex at all.
Canonically I think this sort of thing is (would be?) implemented by
Very interesting indeed. I am not sure I understand completely, but by
intuition I presume that the recursive call actually creates a new
heap allocated LazySeq (with the function definition inside) . So is
there some help from the compiler for this? How does the recursive
call suddenly transfers
Thanks for your replies David and Sean. Yes, I made a mistake thinking
that future takes a function and its arguments, so the function was
never called in my program.
On Nov 25, 8:21 am, David Brown cloj...@davidb.org wrote:
On Tue, Nov 24, 2009 at 09:04:38PM -0800, Hong Jiang wrote:
Hi all,
future also uses the same threadpool as agents, so once you call
future the threadpool spins up, and just sort of sits around for a
while before the jvm decides to exit, which is why the program would
sit around for 50 seconds
On Wed, Nov 25, 2009 at 10:30 AM, Hong Jiang h...@hjiang.net wrote:
On Wed, Nov 25, 2009 at 09:40:44AM -0800, Gabi wrote:
Very interesting indeed. I am not sure I understand completely, but by
intuition I presume that the recursive call actually creates a new
heap allocated LazySeq (with the function definition inside) . So is
there some help from the compiler
Ok. Now I get it. Cool stuff
On Nov 25, 4:18 pm, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
On Nov 25, 9:10 am, Gabi bugspy...@gmail.com wrote:
For example why doesn't the following repeatedly never crash?
(defn repeatedly
[f] (lazy-seq (cons (f) (repeatedly f
Because the
Hi,
Am 23.11.2009 um 21:46 schrieb Garth Sheldon-Coulson:
bound-fn is very nice, but I've found that capturing *all* dynamic
vars is often overkill.
As I said in said thread: I don't think, that this is a big problem.
The number Vars having actually a non-root binding should be rather
On Wed, Nov 25, 2009 at 12:40 PM, Gabi bugspy...@gmail.com wrote:
Very interesting indeed. I am not sure I understand completely, but by
intuition I presume that the recursive call actually creates a new
heap allocated LazySeq (with the function definition inside) .
Not quite; it creates a
I'm trying to write a file scanner very similar to the one on page 131
of Stuart's book:
(ns user
(:use [clojure.contrib.duck-streams :only [reader]]))
(defn scan [dir]
(for [file (file-seq dir)]
(with-open [rdr (reader file)]
(count (filter #(re-find #foobar %) (line-seq rdr))
Forgot to mention: running Clojure 1.0.0- and Clojure-Contrib
1.0-SNAPSHOT according to the pom..
On Thu, Nov 26, 2009 at 7:38 AM, Robert Campbell rrc...@gmail.com wrote:
I'm trying to write a file scanner very similar to the one on page 131
of Stuart's book:
(ns user
(:use
If you have this:
user (def f (future (Thread/sleep 2) :done))
#'user/f
user @f ; this immediate deref blocks for 20 sec, finally returning :block
:done
user @f ; returns immediately
:done
What is actually happening when you call the first @f? You are waiting
for the function to finish
On Thu, Nov 26, 2009 at 8:05 AM, Robert Campbell rrc...@gmail.com wrote:
If you have this:
user (def f (future (Thread/sleep 2) :done))
#'user/f
user @f ; this immediate deref blocks for 20 sec, finally returning
:block
:done
user @f ; returns immediately
:done
What is actually
34 matches
Mail list logo