Re: Proposed Change to str-utils

2009-03-25 Thread linh
> Hi, > > I would generally agree with Stuart that wrapping Java functions is > not a good idea. > > However, string functions come up so often that I think that this is > one area where the rule should be broken, if only for readablility. > I agree, I use these string functions frequently. Mayb

Re: reload modified java class

2009-03-18 Thread linh
to setup since we provide an online update site) > :http://code.google.com/p/clojure-dev/wiki/Documentation > > The site referenced by Meikel seems very interesting for open source > projects, though (javarebel). > > HTH, > > -- > Laurent > > 2009/3/17 linh &g

Re: reload modified java class

2009-03-17 Thread linh
Well I was hoping that someone with more time and skills than me already did that. Thanks for the answers. On Mar 17, 8:14 pm, Stuart Sierra wrote: > On Mar 17, 4:46 am, linh wrote: > > > Is it possible to reload a modified Java class in REPL? > > You could write a custom C

reload modified java class

2009-03-17 Thread linh
Hello, I want to use REPL to quickly test Java code. Is it possible to reload a modified Java class in REPL? I've searched this forum for answers but haven't found any. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: filter1 interesting?

2009-03-15 Thread linh
I like that, that makes the code selfdescribing (is there such a word in english?) On Mar 14, 2:58 pm, Craig Andera wrote: > What about overloading first to accept a predicate? > > (first even? (iterate inc 1)) => 2 > > On Sat, Mar 14, 2009 at 8:58 AM, e wrote: > > >> Christophe Grand suggest (

Re: cells/add-watch question

2009-03-11 Thread linh
i didn't think of that. if equality tests is instant, would finding out the difference also be instant? for example, is this instant: (difference new-set old-set) ? On Mar 11, 11:11 pm, Timothy Pratley wrote: > > This is beacuse my-atom contains a lot > > of data and I don't want to search for t

Re: cells/add-watch question

2009-03-11 Thread linh
Thanks Raffael, I'll try that On Mar 11, 6:42 pm, Raffael Cavallaro wrote: > On Mar 11, 1:24 pm, Raffael Cavallaro > wrote: > > > ;; this just makes a big map atom where integer keys are associated > > with integer values > > should rather be as follows to get integer keyword keys: > > (def my-

cells/add-watch question

2009-03-11 Thread linh
I have a question about cells. I'm not sure how to explain my problem so maybe the easiest way is to show some code. Let's say I have this piece of code: (def my-atom (atom {... big map with many entries ...})) . (add-watch my-atom :update update-fn) . (swap! my-atom (some-fn ...)) When my-atom

Re: clojure macros

2009-03-02 Thread linh
now i've found an interesting article that describes macros in more details http://www.ociweb.com/mark/clojure/article.html#Macros On 2 Mar, 10:27, linh wrote: > hello, > there are lots of good examples of clojure macros on the web, but i > miss a more detailed explanation. >

clojure macros

2009-03-02 Thread linh
hello, there are lots of good examples of clojure macros on the web, but i miss a more detailed explanation. for example what do all these special characters used inside macros really mean ` ' @ ~ # ~...@. anyone know if there's a tutorial for clojure macros (not lisp)? macros are very exotic for

Re: functional programming idiom

2009-03-01 Thread linh
thank you for the information On Mar 1, 5:09 pm, "Michel S." wrote: > On Mar 1, 11:02 am, "Michel S." wrote:> On Feb 28, > 6:16 pm, linh wrote:> hello, > > > what's the common idiom in functional programming regarding checking > > >

functional programming idiom

2009-02-28 Thread linh
hello, what's the common idiom in functional programming regarding checking the validity of arguments to functions. i think this is called defensive programming vs contract programming. for example: ;; this first version of foo checks the validity of arguments inside foo (defn foo [context arg]

Re: The Application Context Pattern

2009-02-27 Thread linh
thanks, this will be very useful for me On 27 Feb, 09:05, Itay Maman wrote: > Some of the reaction for Waterfront was related to the Application > Context Pattern (ACP) - The pattern that allows most of Waterfront's > code to be purely functional. I'll try to explain the basics in this > post. L

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread linh
where can i read about "application context" pattern? i this the idiomatic way to write GUI in functional languages? i'm writing a small swing based app in clojure, and i have problems wirting the gui, because the gui code tends to be very imperative and messy. On 24 Feb, 15:04, Itay Maman wrote

clojure class hierarchy

2009-02-21 Thread linh
where can i find information about clojure's data-structure class hierarchy? i would like to know how seq, map, list, vector and set are related. i'm new to clojure and i don't always understand the api doc. a class hierarchy would make it easier for me to understand what functions can be appied t

how can i do this in clojure

2009-02-19 Thread linh
hi, how can i do this in clojure? # ruby code def foo(x, y) x + y end def bar [1, 2] end foo(*bar) # this is fine, the result will be 3 foo(bar) # this is not ok, will raise exception bar returns an array of size 2, but foo expects 2 parameters not an array. --~--~-~--~~

Re: (newbie) idiomatic way to update a vector/list

2009-02-18 Thread linh
thanks, i thought (assoc map key val) only works for maps, but i should have read the doc more carefully. On Feb 18, 9:34 pm, James Reeves wrote: > On Feb 18, 8:25 pm, linh wrote: > > > hello, > > what is the idiomatic way to do the following in clojure? > > > # rub

(newbie) idiomatic way to update a vector/list

2009-02-18 Thread linh
hello, what is the idiomatic way to do the following in clojure? # ruby pseudo arr = [3 9 4 5] arr[1] = 7 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: do-form swallows exception?

2009-02-17 Thread linh
Thank you for the quick answers. I'm new to clojure and functional programming so this "lazy"-stuff is new to me, but it makes sense and is really cool. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

do-form swallows exception?

2009-02-17 Thread linh
Hi, How come the following code does not throw an exception? (defn foo [] (do (map (fn [_] (throw (RuntimeException. "fail"))) [1 2]) "no exception")) this however does throw exception: (defn foo [] (map (fn [_] (throw (RuntimeException. "fail"))) [1 2])) Is this a bug or am I miss

Re: (newbie) running clojure app without repl

2009-01-16 Thread linh
Thanks for the answers. I'm very excited about Clojure, it seems to have all the features I was missing from Java and Ruby. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

(newbie) running clojure app without repl

2009-01-15 Thread linh
e function, but this function must be called from a clojure application since it's a clojure function, am I right or wrong? Thanks, Linh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou