Re: Evaluation of Symbol Bindings vs. Special Forms

2011-03-15 Thread Ken Wesson
On Tue, Mar 15, 2011 at 11:17 AM, Armando Blancas wrote: >> If so, it's only the subforms not in operator position that get >> macroexpanded first. Otherwise >> >> user=> (defmacro qqq [] 'if) >> #'user/qqq >> user=> ((qqq) (even? 42) "boo!") >> #> in this context (NO_SOURCE_FILE:607)> >> >> would

Re: Polymorphic functions in Clojure (or how to stop thinking in objects)...

2011-03-15 Thread Ken Wesson
On Mon, Mar 14, 2011 at 11:15 PM, Daniel Solano Gomez wrote: > This method works fairly well, and you can even use it to define > protocols for types you don't control, such as classes from a Java API. > > If you need some more complicated form of dispatch for polymorphism, > there is the multimet

Re: Polymorphic functions in Clojure (or how to stop thinking in objects)...

2011-03-15 Thread Ken Wesson
On Tue, Mar 15, 2011 at 12:58 PM, Armando Blancas wrote: > Another choice is to construct shapes as closures with auto-dispatch. > So a circle could be made thus, with no data structure per se: > > (defn make-circle [x y r] >  (fn [method] >    (case method >      :draw (fn [color] ...) >      :ro

Re: How to read this sample code?

2011-03-15 Thread Ken Wesson
(when pred (foo) (bar)) just calls foo and then bar if pred evaluates to logical true, and falls through otherwise. There's no parentheses around the pred, so it just looks up pred without trying to call it as a function. So, it's not pred's return value it's conditioning on, but pred's own va

Re: Software Engineering Practices for Marking Algorithms?

2011-03-15 Thread Ken Wesson
On Wed, Mar 16, 2011 at 12:01 AM, CuppoJava wrote: > If someone knows of a better way of implementing these "marking" > algorithms, or a nice way of organizing these "marker" fields, I would > love to hear your workarounds. HashSets of visited Nodes. Test with contains?. -- You received this me

Re: Software Engineering Practices for Marking Algorithms?

2011-03-16 Thread Ken Wesson
On Wed, Mar 16, 2011 at 7:35 PM, CuppoJava wrote: > Thank you for the reply again Mark. > Actually, now that I've had some time to think about your solution, I > think it, is in fact, suitable for myself after all. There's just some > trickiness involving handing out the numeric ids that I need to

Re: concise description of SLIME indentation rules?

2011-03-17 Thread Ken Wesson
On Thu, Mar 17, 2011 at 6:22 PM, Laurent PETIT wrote: > Lee, while we're at it. > > I decided to finally give it a try, and so I implemented an alternate > behaviour for smart indent for ccw : the version of the gist does the > following : it uses the following function to test whether we should i

Re: slime-eval-at-register

2011-03-17 Thread Ken Wesson
On Thu, Mar 17, 2011 at 7:32 PM, Martin Blais wrote: > Emacs-using Clojurians may enjoy the following tidbit of > Slime I just dreamed of: > > > (defun slime-eval-at-register (reg) >  "Take the cursor to a register's location and eval >   the expression there. Useful for testing stuff without >  

Re: concise description of SLIME indentation rules?

2011-03-18 Thread Ken Wesson
On Fri, Mar 18, 2011 at 4:05 AM, Laurent PETIT wrote: > Sure, this is the target solution. More complex than what I've done, though. > And the gathering of the metadata is not easy, also. Any Clojure IDE that can open a REPL should be able to get at the metadata. Just eagerly spawn a runtime with

Re: concise description of SLIME indentation rules?

2011-03-18 Thread Ken Wesson
On Fri, Mar 18, 2011 at 7:24 AM, Laurent PETIT wrote: >> Ah, you're worried about resolve? > > Not at all. ns-resolve will not discover vars if the namespace hasn't been > required, used or loaded first. It's the user's own damn fault if some things won't indent the way they should because the so

Re: Can't "recur" from within a "catch" expression.

2011-03-18 Thread Ken Wesson
On Fri, Mar 18, 2011 at 1:13 PM, Shantanu Kumar wrote: > The `try-times` macro above is buggy (doesn't work when body of code > returns logical false). Fixed version is below: > > (defmacro try-times >  [n & body] {:pre [(posnum? n)]} >  `(let [c# (repeat-exec (dec ~n) #(maybe ~@body)) >         r

Re: ClojureCLR startup times...

2011-03-18 Thread Ken Wesson
On Fri, Mar 18, 2011 at 11:42 AM, dmiller wrote: > core.clj and company are AOT-compiled.  The dll's are loaded during > startup, not the clojure source. > When I run a profiler on it during startup, it reports almost all time > being taken by the JITter. > > I'm open to suggestions on improving t

Re: Operations inside associative structures

2011-03-18 Thread Ken Wesson
On Fri, Mar 18, 2011 at 9:04 PM, Nick wrote: > I'm looking to do some operations upon the data in an associative > structure.  What do you think about this method of hijacking the > definition of assoc-in?  Is there some better way to do what I'm doing > here? > > user> (defn op-in [op m [k & ks]

Re: Can't "recur" from within a "catch" expression.

2011-03-18 Thread Ken Wesson
It occurs to me you probably only want the delay between successive retries, so really you want to put the delay in the retrying code, or maybe use interpose in some manner (and make the interposed delay function look like a failure to the surrounding loop). -- You received this message because y

Re: Dynamic scoping issue

2011-03-20 Thread Ken Wesson
On Sun, Mar 20, 2011 at 4:16 PM, Tassilo Horn wrote: > the println prints {Locality localities.Locality}, which is correct. > However, my resolving function errors because there is no class > Locality.  In the error message, I also print the value of > *schema-imports*, and in fact, it is {}. Doe

Re: Dynamic scoping issue

2011-03-20 Thread Ken Wesson
On Sun, Mar 20, 2011 at 5:17 PM, Tassilo Horn wrote: > Ken Wesson writes: > >>> the println prints {Locality localities.Locality}, which is correct. >>> However, my resolving function errors because there is no class >>> Locality.  In the error message, I al

Re: Dynamic scoping issue

2011-03-20 Thread Ken Wesson
On Sun, Mar 20, 2011 at 5:41 PM, Tassilo Horn wrote: > Ken Wesson writes: > > Hi Ken, > >>>> Does the resolving function run on, or use, another thread? >>> >>> No, it runs in the same thread.  But some functions like `vseq' in >>>

Re: Dynamic scoping issue

2011-03-21 Thread Ken Wesson
On Mon, Mar 21, 2011 at 4:03 AM, Tassilo Horn wrote: > Why do I use a dynamic var in the first place?  I want to use the simple > names in the lexical scope of the `with-schema-imports' block, and I > used a dynamic var only because the resolution takes place somewhere in > the function call tree

Re: one argument versions of conj and disj would be very nice

2011-03-22 Thread Ken Wesson
On Tue, Mar 22, 2011 at 5:08 AM, Shantanu Kumar wrote: > On Mar 22, 1:15 pm, Sunil S Nandihalli > wrote: >> Hello everybody, >>  I was wondering why there is no 1 argument version of conj and disj. I >> think that would be very convenient. Especially when used in the following >> way >> >> (apply

Re: beginner clojure question: OutOfMemory error processing (slightly) large data file

2011-03-22 Thread Ken Wesson
On Tue, Mar 22, 2011 at 4:00 PM, Avram wrote: > Hi, > > I (still) consider myself new to clojure.  I am trying to read a 37Mb > file that will grow 500k every 2 days. I don't consider this to be > input large enough file to merit using Hadoop and I'd like to process > it in Clojure in an efficient

Re: gen-class and state...

2011-03-23 Thread Ken Wesson
On Wed, Mar 23, 2011 at 3:43 AM, Jules wrote: > I only have a brief posting window this morning (I have to leave for > work) so have not researched this as well as I should before coming to > the list - so please forgive if this is a bit lame... > > Should I still be using gen-class to achieve lin

Re: Implicit unpacking of a map

2011-03-24 Thread Ken Wesson
What about this? First, use :title and :body keywords instead of "title" and "body" strings as keys in form-params. Then define this utility function: (defn get-seq [m & kws] ((apply juxt kws) m)) which takes a map and one or more keywords (cannot be other types of key) and returns a seq (actua

Re: Jesus, how the heck to do anything?

2011-03-24 Thread Ken Wesson
On Fri, Mar 25, 2011 at 12:36 AM, ultranewb wrote: > On Mar 25, 8:58 am, Sean Corfield wrote: >> My final year project at university was to write an APL interpreter >> (in Pascal, back in '83). APL is a fun language. I haven't looked at J >> (yet). > > Awesome! > > J is APL, but totally "moderniz

Re: Jesus, how the heck to do anything?

2011-03-25 Thread Ken Wesson
On Fri, Mar 25, 2011 at 4:40 AM, ultranewb wrote: > I'm sure you are right, but I see asians using American keyboards with > English alphabets to write Chinese, Japanese, and everything else > every day.  And with a few keystrokes, they switch between writing in > English and writing in (insert as

Re: Jesus, how the heck to do anything?

2011-03-25 Thread Ken Wesson
On Fri, Mar 25, 2011 at 4:08 AM, Michael Wood wrote: > On 25 March 2011 07:15, Ken Wesson wrote: >> On Fri, Mar 25, 2011 at 12:36 AM, ultranewb wrote: > [...] >>> One other difference with APL is that they removed the old complaint >>> of "special characte

Re: Implicit unpacking of a map

2011-03-25 Thread Ken Wesson
On Fri, Mar 25, 2011 at 5:09 AM, Thorsten Wilms wrote: > On 03/25/2011 01:34 AM, Ken Wesson wrote: >> >> What about this? First, use :title and :body keywords instead of >> "title" and "body" strings as keys in form-params. Then define this >>

Re: Implicit unpacking of a map

2011-03-25 Thread Ken Wesson
On Fri, Mar 25, 2011 at 9:03 AM, Thorsten Wilms wrote: > On 03/25/2011 11:37 AM, Ken Wesson wrote: > >>> By now I'm rather sure this would trigger an error, as nothing but an >>> immediate call of Article. seems acceptable for ds/save!. >> >> Why d

Re: Namespace and file structuring

2011-03-25 Thread Ken Wesson
On Fri, Mar 25, 2011 at 6:00 PM, Stuart Sierra wrote: > I try to use namespaces in layers.  Each namespace defines an "interface" as > a set of functions, and only calls functions of the layer(s) "below" it.  I > build from small utilities and Java interop at the "bottom" layer, to > application-l

Re: A newbie's summary - what worked, what didn't

2011-03-28 Thread Ken Wesson
On Mon, Mar 28, 2011 at 8:51 AM, Lee Spector wrote: > > On Mar 28, 2011, at 5:16 AM, Luc Prefontaine wrote: > >> Given the huge number of libraries/projects available these days >> and the diverse profile of library maintainers, a totally >> automated/transparent >> dependency manager is not for

Re: A newbie's summary - what worked, what didn't

2011-03-28 Thread Ken Wesson
On Mon, Mar 28, 2011 at 2:27 PM, Larry Travis wrote: > Kasim: > I just discovered ClojureW, and it looks promising. I will report my > reaction after I get time to thoroughly test it for the kinds of things I am > doing. > > In the meantime, a request: > > When you work 'on a "Just Works" emacs se

Re: Calling Clojure from Java: unbound function

2011-03-28 Thread Ken Wesson
On Mon, Mar 28, 2011 at 8:46 AM, Mark Meyer wrote: > Hi. > I'm having problems calling clojure code from Java. Basically I deftype'd > (deftype HexSolver [] >   Solver >   (solve [this grid] (search (process-grid grid > and somewhere near the top of that file file > (defn search [foo] ...) > t

Re: using clojure for (java) code generation; advice sought

2011-03-29 Thread Ken Wesson
On Tue, Mar 29, 2011 at 4:43 PM, B Smith-Mannschott wrote: > On Tue, Mar 29, 2011 at 18:44, Saul Hazledine wrote: >> On Mar 29, 3:13 pm, B Smith-Mannschott wrote: >>> >>> (defn constructor >>>  [{:keys [class-name fields] :as cfg}] >>>  ["    " class-name "(" (formal-params cfg) ") {\n" >>>   (s

Re: fixing web docs

2011-03-29 Thread Ken Wesson
On Tue, Mar 29, 2011 at 2:03 PM, Sean Corfield wrote: > Having one central authoritative Getting Started page might be a good > thing. +1 > However, the official page isn't very welcoming for newbies right now > since it assumes you either start with an IDE or a build tool. > Pointing out try-cl

Re: fixing web docs

2011-03-29 Thread Ken Wesson
On Tue, Mar 29, 2011 at 8:21 PM, Devin Walters wrote: > TryClojure is an opportunity, not a liability. Treat it as such. Oh, I agree that it is an opportunity, but in its present yo-yo state it will reflect poorly on the main site and have unintended consequences. I wholeheartedly support the ide

Re: (memoize) and recursive functions (Clojure 1.2)

2011-03-30 Thread Ken Wesson
On Wed, Mar 30, 2011 at 12:02 PM, Laurent PETIT wrote: > Except in 1.3 it will be a little bit harder to do "throw-away" per-thread > memoizes for vars you do no "own" if their author didn't make their holding > var :dynamic ('cause then you will not be able to rebind them). > > This is close to b

Re: (memoize) and recursive functions (Clojure 1.2)

2011-03-31 Thread Ken Wesson
On Thu, Mar 31, 2011 at 3:24 PM, Laurent PETIT wrote: > 2011/3/31 Ken Wesson >> >> On Wed, Mar 30, 2011 at 12:02 PM, Laurent PETIT >> wrote: >> > Except in 1.3 it will be a little bit harder to do "throw-away" >> > per-thread >> > mem

NB/Enclojure issues

2011-03-31 Thread Ken Wesson
(I'm aware that there's a separate Enclojure Google Group but it seems to get very little traffic, and I've seen similar issues to mine raised there for literally years without seeing an answer posted there, so I'm asking here.) While Enclojure provides a decent REPL and generally decent editing U

Re: (memoize) and recursive functions (Clojure 1.2)

2011-04-01 Thread Ken Wesson
On Fri, Apr 1, 2011 at 1:59 AM, Laurent PETIT wrote: > 2011/4/1 Ken Wesson >> >> On Thu, Mar 31, 2011 at 3:24 PM, Laurent PETIT >> wrote: >> > 2011/3/31 Ken Wesson >> >> >> >> On Wed, Mar 30, 2011 at 12:02 PM, Laurent PETIT >> &g

Re: NB/Enclojure issues

2011-04-01 Thread Ken Wesson
On Fri, Apr 1, 2011 at 2:02 AM, Laurent PETIT wrote: > You should really consider adding a ;tldr section in your posts ... What? And why do you seem to be trying to redirect replies to your on-list posts to your personal email? -- You received this message because you are subscribed to the Goo

Re: Example to introspect a class

2011-04-01 Thread Ken Wesson
On Fri, Apr 1, 2011 at 10:56 AM, Mushfaque Chowdhury wrote: > Hi > > I'm trying to solve a introspection problem of the following type > > (def Region {'fields '((datatype x) (datatype y))}) > > (def Country {'fields '((int x) (double y {reference `Region}))}) > > I'd like to introspect the fields

Re: Off-Topic: Looking for Lisp in Small Pieces

2011-04-02 Thread Ken Wesson
On Sat, Apr 2, 2011 at 2:38 PM, Marc Spitzer wrote: > have you tried inter-library loan? Or bittorrent? If you're willing to go that route, a cursory web search seems to indicate it exists there. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

REPL bug: premature submission hitting enter with unmatched [

2011-04-02 Thread Ken Wesson
user=> (defn radix-tree-set [things] [(zipmap things (iterate inc 0)) # user=> # user=> WTF is going on here? Enter after the first line (with an unmatched open parenthesis) moves to a second line instead of submitting the form, as expected. However, enter after the second line produces d

Re: Is there a way to make a symbol throw an exception, when it's referenced?

2011-04-02 Thread Ken Wesson
On Sat, Apr 2, 2011 at 4:30 PM, icemaze wrote: > I'm writing a macro that defines a symbol through let, but I also > needs to unbind (unlet?) it, so that further uses of that symbol throw > an exception. Design things in the functional way, and the let's close parenthesis will do that for you. O

Radix tree set; efficient storage of a set of strings to match against; and efficient hash storage?

2011-04-02 Thread Ken Wesson
(defn radix-tree-set [things] (let [sentinel (Object.) vs (cons sentinel things) nt (vec (repeat (count vs) nil))] [(zipmap vs (iterate inc 0)) nt sentinel nt])) (defn radix-tree-set-contains? [[m nt sentinel t] s] (get-in t (map m (concat s [sentinel] (defn radix-tree

Re: REPL bug: premature submission hitting enter with unmatched [

2011-04-02 Thread Ken Wesson
On Sat, Apr 2, 2011 at 7:01 PM, Alan wrote: > Works fine for me in slime, came repl, and java -jar clojure.jar. The > indentation isn't so hot for the raw repl, but what can you expect? > The repl is fine; perhaps you should tell us how you're launching your > repl, since that seems to be the sour

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-02 Thread Ken Wesson
On Sat, Apr 2, 2011 at 11:38 PM, Stefan Rohlfing wrote: > I am sure there is a standard functional way of comparing adjacent items in > a coll and would be glad if someone could point me to it. (defvar- sentinel (Object.)) (defn take-by [f coll] (let [fs (map f coll) ps (map = fs (rest

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-02 Thread Ken Wesson
On Sun, Apr 3, 2011 at 12:16 AM, Ken Wesson wrote: > On Sat, Apr 2, 2011 at 11:38 PM, Stefan Rohlfing > wrote: >> I am sure there is a standard functional way of comparing adjacent items in >> a coll and would be glad if someone could point me to it. > > (defvar- senti

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-03 Thread Ken Wesson
On Sun, Apr 3, 2011 at 1:04 AM, Andreas Kostler wrote: >                       (map (fn [x y] [x y]) coll (rest coll)) What's your reason for using (fn [x y] [x y]) here instead of just vector? Is it more efficient because it isn't variable-arity? -- You received this message because you are su

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-03 Thread Ken Wesson
On Sun, Apr 3, 2011 at 3:23 AM, Stefan Rohlfing wrote: > @ Ken, Andreas > > Thank you for your nice implementations! > > As far as I can see, there are two main methods of comparing adjacent items > of a list: > > 1) Take the first item of a coll. Compare the remaining items with an offset > of 1:

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-03 Thread Ken Wesson
On Sun, Apr 3, 2011 at 7:15 AM, Meikel Brandmeyer wrote: > Hi, > > On 3 Apr., 12:24, Ken Wesson wrote: > >> I don't. :) >> >> (defn drop-by [f coll] >>   (let [fs (map f coll) >>         ps (map = fs (rest fs)) >>         zs (map list ps

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-03 Thread Ken Wesson
On Sun, Apr 3, 2011 at 8:45 AM, Roman Sykora <4rt.f...@gmail.com> wrote: > Now, my question is what's the improvement of > >> (defn take-by [f coll] >>   (let [fs (map f coll) >>          ps (map = fs (rest fs)) >>          zs (map #(if %1 %2 sentinel) ps (rest coll))] >>     (cons (first coll) (ta

Re: April Showers Bring May Flowers - raindrop advice please

2011-04-03 Thread Ken Wesson
On Sun, Apr 3, 2011 at 5:10 PM, carinmeier wrote: > I am experimenting with Java Graphics and Clojure.  I made a Gist that > draws a frame with some text, grass and raindrops falling.  I made a > function that draws a raindrop falling and I created agents to send > off the drawing of the raindrop.

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Ken Wesson
> I summarised my issues with the different solutions. Since things got > a bit philosophical I wrote up a short blog post on my point of view: > http://bit.ly/hInw0J I'm surprised to hear that partition-by is not very lazy, and will hang on an infinite seq. Fortunately, that can be fixed: (defn

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-04 Thread Ken Wesson
On Mon, Apr 4, 2011 at 7:07 PM, Ken Wesson wrote: >> I summarised my issues with the different solutions. Since things got >> a bit philosophical I wrote up a short blog post on my point of view: >> http://bit.ly/hInw0J > > I'm surprised to hear that partition-by is n

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 2:27 AM, Meikel Brandmeyer wrote: > Hi, > > On 5 Apr., 01:27, Ken Wesson wrote: > >> Oh, and it also doesn't hold onto the head: > > Your version of partition-by is basically equivalent to: > > (defn partition-by >  [f coll] &g

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-05 Thread Ken Wesson
>> If I understand your claim correctly, it's therefore wrong. > > Since it's correct, you don't understand my claim correctly. That is rather rude and arrogant. > Using your partition-by. [snip] This seems to contradict the test results I posted earlier. Perhaps it is behaving differently on yo

Re: (take-by f coll), (drop-by f coll): Problem Comparing Adjacent Items Of A Collection

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 8:09 AM, Meikel Brandmeyer wrote: > (defn partition-by [f s] >  (lazy-seq >    (let [s (seq s)] >      (if s >        (let [fs (map f s) >              eq (cons true (map = fs (rest fs))) >              eqs (seq (map list eq s)) >              step (fn step [eqs] >          

What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Ken Wesson
I keep a tab parked at the Clojure cheat sheet, and just now I clicked a link there. When I hit back, instead of the browser displaying the cheat sheet again, as it should have, it displayed a big block of ads and other cruft with no cheat sheet in sight! The cheat sheet web page has apparently be

Re: What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 9:59 AM, Ken Wesson wrote: > On Tue, Apr 5, 2011 at 9:58 AM, Aaron Bedra wrote: >> On 04/05/2011 09:55 AM, Ken Wesson wrote: >>> >>> I keep a tab parked at the Clojure cheat sheet, and just now I clicked >>> a link there. When I hit bac

Re: What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 9:58 AM, Aaron Bedra wrote: > On 04/05/2011 09:55 AM, Ken Wesson wrote: >> >> I keep a tab parked at the Clojure cheat sheet, and just now I clicked >> a link there. When I hit back, instead of the browser displaying the >> cheat sheet again, as i

Re: What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 12:29 PM, Mike Meyer wrote: > On Tue, 5 Apr 2011 10:00:28 -0400 > Ken Wesson wrote: >> And why would it come up as a page full of ads (mostly pretty scammy >> looking ads, like fake Windows messageboxes and such) instead of a >> Host Unknown

Re: What the hell is going on with the Clojure cheat sheet?

2011-04-05 Thread Ken Wesson
On Tue, Apr 5, 2011 at 12:53 PM, Baishampayan Ghose wrote: > On Tue, Apr 5, 2011 at 10:17 PM, Ken Wesson wrote: >>>> And why would it come up as a page full of ads (mostly pretty scammy >>>> looking ads, like fake Windows messageboxes and such) instead o

Re: clj3D, a Clojure 3D Library

2011-04-06 Thread Ken Wesson
On Wed, Apr 6, 2011 at 5:50 AM, Alfredo wrote: > First screencast is out! > > http://www.youtube.com/watch?v=_fLgBzRdddU Can anyone else who's using Chrome see these videos? I just get a black box with text saying "You need to upgrade your Adobe Flash Player to watch this video. Download it from

Re: clj3D, a Clojure 3D Library

2011-04-06 Thread Ken Wesson
On Wed, Apr 6, 2011 at 4:46 PM, Benny Tsai wrote: > Works for me (Chrome 10.0.648.204, Windows XP SP3). Well, this is just screwy. I have tried restarting Chrome, disabling and re-enabling its Flash plugin, and various other things. No joy. And Chrome says the version I have is 10.2.154.25. YouTu

Re: clj3D, a Clojure 3D Library

2011-04-06 Thread Ken Wesson
On Wed, Apr 6, 2011 at 10:10 PM, Shantanu Kumar wrote: > Works for me on Chrome 10.0.648.204 on Mac OS X. Are you using a > Chrome beta? > > On Apr 6, 11:56 pm, Ken Wesson wrote: >> On Wed, Apr 6, 2011 at 5:50 AM, Alfredo wrote: >> > First screencast is out! >>

Re: clj3D, a Clojure 3D Library

2011-04-06 Thread Ken Wesson
On Wed, Apr 6, 2011 at 10:32 PM, Ken Wesson wrote: [blank message] Dammit, I didn't send that. More Chrome glitchiness. I clicked the "Reply" link on Shantanu's message dated 10:10 PM April 6, the browser did nothing, and I clicked "Reply" again after a few secon

Re: clj3D, a Clojure 3D Library

2011-04-07 Thread Ken Wesson
On Wed, Apr 6, 2011 at 5:18 PM, Ken Wesson wrote: > On Wed, Apr 6, 2011 at 4:46 PM, Benny Tsai wrote: >> Works for me (Chrome 10.0.648.204, Windows XP SP3). > > Well, this is just screwy. I have tried restarting Chrome, disabling > and re-enabling its Flash plugin, and variou

Re: help--reading keyboard input from Clojure is surprisingly difficult

2011-04-08 Thread Ken Wesson
On Fri, Apr 8, 2011 at 2:52 AM, Gregg Williams wrote: > Having worked with Clojure for over a year, I can sympathize with > Clojure beginners (like myself) who find it extremely difficult to do > simple things with Clojure. (It took me weeks to get Clojure working > with Emacs, Swank, and the Cloj

Re: examples in doc strings

2011-04-08 Thread Ken Wesson
> For example, (doc defmethod) could go from this: > > > clojure.core/defmethod > ([multifn dispatch-val & fn-tail]) > Macro >  Creates and installs a new method of multimethod associated with > dispatch-value. > > > to something like this: > > > clojure.core/defmethod >

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-08 Thread Ken Wesson
On Fri, Apr 8, 2011 at 9:48 PM, James Reeves wrote: > I'm saying that if a predicate is passed a value that doesn't match a > precondition, the predicate could return a truthy value, rather than > false. Better yet: maybe we're looking at this backwards. Maybe what we want isn't a predicate for *

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-09 Thread Ken Wesson
On Sat, Apr 9, 2011 at 9:56 AM, James Reeves wrote: > On 8 April 2011 23:21, Ken Wesson wrote: >> Better yet: maybe we're looking at this backwards. Maybe what we want >> isn't a predicate for *passed* validation, but a predicate for >> *failed* validation: &

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-10 Thread Ken Wesson
On Sat, Apr 9, 2011 at 10:12 PM, James Reeves wrote: > On 9 April 2011 10:07, Ken Wesson wrote: >>> That particular example ties a predicate to a particular error >>> message. Error messages should be independent of predicates, otherwise >>> they can't be loc

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-10 Thread Ken Wesson
On Sun, Apr 10, 2011 at 11:42 AM, James Reeves wrote: > On 10 April 2011 09:49, Ken Wesson wrote: >> (def age-invalid-en >>  {:low "age must be at least 1" >>   :high "nobody is THAT old!" >>   :blank "age is required" >>   :non-i

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-10 Thread Ken Wesson
On Sun, Apr 10, 2011 at 1:37 PM, James Reeves wrote: > By adding error messages to predicates, we tightly couple the > validation error with the predicate, which in general is considered > bad. However, this might be a valid compromise, but only if it > improves readability. I showed two posts ag

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 3:09 AM, James Reeves wrote: > On 10 April 2011 22:24, Ken Wesson wrote: >> On Sun, Apr 10, 2011 at 1:37 PM, James Reeves >> wrote: >>> By adding error messages to predicates, we tightly couple the >>> validation error with the predicat

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 4:12 AM, James Reeves wrote: > On 11 April 2011 08:31, Ken Wesson wrote: >>> So your not-int-in-range? function is a compound function, made up of >>> four simple functions. >> >> So? This whole discussion arose because some of them have

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 5:07 AM, Meikel Brandmeyer wrote: >> What is your basis for this? > > Because the phantasy of the average human being is quite limited. ? > While a missed "this is allowed" might cause trouble, it doesn't > compromise the system. A missed "this is not allowed" however wil

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 5:29 AM, Meikel Brandmeyer wrote: > Hi, > > On 11 Apr., 11:16, Ken Wesson wrote: > >>> Just for illustration: Who designs a system, which starts an atomic >>> war on a bitflip in a test message? (Yeah, this happened and we are >>> o

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 6:27 AM, Meikel Brandmeyer wrote: > Although not every system launches the Rockets, I'd prefer systems > with robustness and fault tolerance as default. Even if it's only the > egg clock gadget. But you must admit that the mission-criticalness of robustness and fault toler

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 7:17 AM, Meikel Brandmeyer wrote: > >> I do. And I also admit, that I think that someone not able to write a >> simple, non-critical application in a robust and fault tolerant way >> per default is a able to write a complex, critical application in a >> robust and fault tol

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 1:09 PM, James Reeves wrote: > On 11 April 2011 09:43, Ken Wesson wrote: >> On Mon, Apr 11, 2011 at 4:12 AM, James Reeves >> wrote: >>> Yes, but remember that I said I was looking for non-compound >>> solutions. In my view, simple fun

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 7:09 PM, James Reeves wrote: > On 11 April 2011 21:26, Ken Wesson wrote: >> On Mon, Apr 11, 2011 at 1:09 PM, James Reeves >> wrote: >>> If you already have a, b, and c, then compounding them into one >>> function, only to then use a m

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-11 Thread Ken Wesson
On Mon, Apr 11, 2011 at 10:23 PM, James Reeves wrote: > On 12 April 2011 01:41, Ken Wesson wrote: >> On Mon, Apr 11, 2011 at 7:09 PM, James Reeves >> wrote: >>> You wouldn't necessarily need to explicitly verify each precondition, >>> but it might be t

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-12 Thread Ken Wesson
On Tue, Apr 12, 2011 at 6:34 AM, James Reeves wrote: > On 12 April 2011 04:31, Ken Wesson wrote: >> There's a difference between the program parsing the same *object* >> multiple times, and the program's own source code containing >> duplication! > > But

Re: Announcement: pretzel - a predicate library + call for suggestions

2011-04-12 Thread Ken Wesson
On Tue, Apr 12, 2011 at 8:05 AM, James Reeves wrote: > On 12 April 2011 12:02, Ken Wesson wrote: >> Don't be ridiculous. If you're putting that (chain ...) sexp of yours >> in every separate place where a field is checked for being an integer >> in a range, then

Enclojure REPL problems

2011-04-12 Thread Ken Wesson
There are several buggy behaviors of the Enclojure REPL that are annoying me. Enclojure has gone through several upgrades over the past year or two without any of these being fixed, despite the fact that people have reported these problems more than once on the Enclojure Google Group during that ti

Re: Enclojure REPL problems

2011-04-13 Thread Ken Wesson
On Wed, Apr 13, 2011 at 8:45 AM, Chas Emerick wrote: > > On Apr 13, 2011, at 1:08 AM, Ken Wesson wrote: > >> Since these issues have been raised on the Enclojure Google Group by >> various people repeatedly over the last couple of years, to no effect, >> it seems

Re: partial vs anonymous function?

2011-04-14 Thread Ken Wesson
On Thu, Apr 14, 2011 at 10:42 AM, Mark Rathwell wrote: > > Actually, that doesn't seem to be the case, seems to have something to do > with the closure affecting macro expansion, but again, need someone smarter > to explain: > user> (defn plus-x [x] (fn [y] (+ x y))) > #'user/plus-x > user> (eval

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread Ken Wesson
On Wed, Apr 13, 2011 at 1:22 PM, Brandon Ferguson wrote: > I'm not sure if this is the place to ask this but I've been struggling > with a few things in the world of Clojure. I've been using Processing > to learn Clojure (since I'm somewhat familiar with Processing) but the > tough part has been d

Re: partial vs anonymous function?

2011-04-14 Thread Ken Wesson
On Thu, Apr 14, 2011 at 12:26 PM, Armando Blancas wrote: > I wonder in which cases this code is a good choice: a function that > returns uneval'ed code. Something about macros not being an option > where a function is expected, or a kind of lazy eval? Will this be any > better or worse: (defn m [f

Very odd memory allocation behavior

2011-04-14 Thread Ken Wesson
I've been using Clojure to automate some file management tasks over here; in particular, I whipped together about 100 lines of code to build and maintain a hash database of certain files and thereby efficiently discover duplications among these files. (Basically, it uses a subdirectory of the files

Re: Very odd memory allocation behavior

2011-04-15 Thread Ken Wesson
On Fri, Apr 15, 2011 at 4:17 AM, Alan wrote: > Holy cow wall of text. I really couldn't get through the whole thing, > but I scanned it and I don't see you mentioning output-stream > buffering, which would be one of my primary suspects for this sort of > behavior. I didn't mention it because it i

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 5:12 AM, Zlatko Josic wrote: > Hi, > I would like to start two progams from Eclipse. One is a server and the > other one is a client. > I use Load Clojure file in REPL from Eclipse menu. When I start the server > it never ends because > the server has endless loop where it

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 5:30 PM, Michael Wood wrote: > On 23 April 2011 17:31, Ken Wesson wrote: >> On Sat, Apr 23, 2011 at 5:12 AM, Zlatko Josic wrote: >>> Hi, >>> I would like to start two progams from Eclipse. One is a server and the >>> other one is a cl

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 8:13 PM, Mike Meyer wrote: > On Sat, 23 Apr 2011 19:41:28 -0400 > Ken Wesson wrote: >> > Well, Java servers probably are yes, but traditional Unix servers >> > would normally fork a new process for each incoming connection. >> >&

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 11:26 PM, Alan wrote: > On Apr 23, 4:41 pm, Ken Wesson wrote: >> On Sat, Apr 23, 2011 at 5:30 PM, Michael Wood wrote: >> > On 23 April 2011 17:31, Ken Wesson wrote: >> >> On Sat, Apr 23, 2011 at 5:12 AM, Zlatko Josic >> >>

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 11:28 PM, Ken Wesson wrote: > On Sat, Apr 23, 2011 at 11:26 PM, Alan wrote: >> On Apr 23, 4:41 pm, Ken Wesson wrote: >>> On Sat, Apr 23, 2011 at 5:30 PM, Michael Wood wrote: >>> > On 23 April 2011 17:31, Ken Wesson wrote: >>> >

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sat, Apr 23, 2011 at 11:35 PM, Mike Meyer wrote: > On Sat, 23 Apr 2011 23:19:53 -0400 > Ken Wesson wrote: > >> On Sat, Apr 23, 2011 at 8:13 PM, Mike Meyer wrote: >> > On Sat, 23 Apr 2011 19:41:28 -0400 >> > Ken Wesson wrote: >> > or you live in a un

Re: Start Clojure programs from Eclipse

2011-04-23 Thread Ken Wesson
On Sun, Apr 24, 2011 at 12:01 AM, Mike Meyer wrote: > On Sat, 23 Apr 2011 23:42:23 -0400 > Ken Wesson wrote: > >> On Sat, Apr 23, 2011 at 11:35 PM, Mike Meyer wrote: >> > On Sat, 23 Apr 2011 23:19:53 -0400 >> > Ken Wesson wrote: >> > >> >&

Re: Start Clojure programs from Eclipse

2011-04-24 Thread Ken Wesson
On Sun, Apr 24, 2011 at 3:25 AM, Mike Meyer wrote: [massive snip] >> Ah, I get it. You're arguing because you have some kind of *personal* >> issue, rather than for any logical reason. > > Yup. Well, then. >> > Sure, a hardware glitch that affects the OS means you should reboot >> > the system.

  1   2   3   4   5   6   7   8   9   10   >