Re: Experiment with named args

2009-07-17 Thread Mark Addleman
The sufficiently smart compiler argument comes to mind: if the arglist of a function is known, then surely the compiler should be able to automatically translate named/keyword arguments into an appropriate simple call? That is exactly what motivated me to write this macro. I was pretty sure

Re: Experiment with named args

2009-07-17 Thread Laurent PETIT
2009/7/17 Mark Addleman mark_addle...@bigfoot.com The sufficiently smart compiler argument comes to mind: if the arglist of a function is known, then surely the compiler should be able to automatically translate named/keyword arguments into an appropriate simple call? That is exactly

Re: Algorithm help

2009-07-17 Thread martin_clausen
Thanks. Your code is definitely much more idiomatic Clojure - and 3X faster. The lcs function does exactly what it is suppose to, but the backtrack-all function only returns the first LCS found(for the strings AATCC ACACG = (ACC), whereas the Python version returns all the LCSes found (for the

Re: Experiment with named args

2009-07-17 Thread Nicolas Oury
Hello, Can this construct handle higher-order functions? (I mean a function with named arguments as an argument to another function). It seems quite difficult to do a function dependent transformation on the call site when the function is unknown. Best regards, Nicolas. On Thu, 2009-07-16 at

Re: Algorithm help

2009-07-17 Thread Mark Triggs
Heheh, three times slower but gives the wrong answer--maybe not a great trade-off :o) I'd misread the way the last if statements work in the Python version. I modified mine to read: (defn backtrack-all [c x y i j] (cond (or (zero? i) (zero? j)) #{} (= (get x (dec i)) (get y

Re: comment macro not ignoring contents

2009-07-17 Thread philip.hazel...@gmail.com
On Jul 17, 4:56 am, Richard Newman holyg...@gmail.com wrote: If you want unsyntactic input in your file, comment it out with   semicolons. Adding true block comments -- #| |# -- is on the to-do list. While we're on the subject, are there any plans for a sexp-comment? Essentially I'm looking

Re: comment macro not ignoring contents

2009-07-17 Thread Rich Hickey
On Fri, Jul 17, 2009 at 8:13 AM, philip.hazel...@gmail.comphilip.hazel...@gmail.com wrote: On Jul 17, 4:56 am, Richard Newman holyg...@gmail.com wrote: If you want unsyntactic input in your file, comment it out with semicolons. Adding true block comments -- #| |# -- is on the to-do list.

Re: easiest JMX API ever, in Clojure...

2009-07-17 Thread Michael Wood
2009/7/16 Daniel dan.in.a.bot...@gmail.com: On Thu, Jul 16, 2009 at 10:20 PM, Michael Woodesiot...@gmail.com wrote: [...] What I am wondering now is whether it's possible to use JBoss' RMI connector/object server (on port 1099) with Stuart's JMX library.  If I just try pointing it at port

Very minor problem in the REPL

2009-07-17 Thread AlamedaMike
This is so trivial from a technical standpoint I'm embarrassed to mention it. The REPL is accepting more than one sexp on a line and then generating output for all of them in an unusual fashion. In the following, all text after the first line is generated by clojure (except for the comment, of

Re: Very minor problem in the REPL

2009-07-17 Thread Andrew Wagner
Sounds like a good application of the broken window principle to me. On Fri, Jul 17, 2009 at 9:05 AM, AlamedaMike amino.metr...@gmail.comwrote: This is so trivial from a technical standpoint I'm embarrassed to mention it. The REPL is accepting more than one sexp on a line and then

How to use vimClojure?

2009-07-17 Thread Dragan Djuric
Hi, I have installed vimClojure and it seems to work, but... how to push the code to the REPL? I have defined a function, typed \sr - REPL started... the fn is not accessible... tried typinf \ef '\el and their cousins to the vim command but nothing happens. I am a notal novice to vim, so the

Re: easiest JMX API ever, in Clojure...

2009-07-17 Thread Daniel
On Fri, Jul 17, 2009 at 7:59 PM, Michael Woodesiot...@gmail.com wrote: 2009/7/16 Daniel dan.in.a.bot...@gmail.com: On Thu, Jul 16, 2009 at 10:20 PM, Michael Woodesiot...@gmail.com wrote: [...] What I am wondering now is whether it's possible to use JBoss' RMI connector/object server (on

Re: How to use vimClojure?

2009-07-17 Thread Meikel Brandmeyer
Hi, On Jul 17, 3:51 pm, Dragan Djuric draga...@gmail.com wrote: I have installed vimClojure and it seems to work, but... how to push the code to the REPL? Ok. Let's see. Step by step... 0. Start ng-server 1. Start a fresh vim. 2. :setfiletype clojure (a colon command like :w or :q) 3. \sr

Re: Experiment with named args

2009-07-17 Thread Mark Addleman
On Jul 16, 11:50 pm, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/7/17 Mark Addleman mark_addle...@bigfoot.com The sufficiently smart compiler argument  comes to mind: if the arglist of a function is known, then surely the  compiler should be able to automatically translate

Re: Very minor problem in the REPL

2009-07-17 Thread Stephen C. Gilardi
On Jul 17, 2009, at 9:05 AM, AlamedaMike wrote: As I say, technically very trivial, but it violates the principal of least surprise (for me). I bring it up only because of reasons of broader acceptance by the business community. I know how some of them think, and even trivial stuff like this

Re: Experiment with named args

2009-07-17 Thread Chouser
On Fri, Jul 17, 2009 at 11:21 AM, Mark Addlemanmark_addle...@bigfoot.com wrote: On Jul 17, 2:35 am, Nicolas Oury nicolas.o...@gmail.com wrote: Hello, Can this construct handle higher-order functions? Nope :) Chouser brought up this point in IRC.  It's not even clear what the syntax

Re: Examining performance on the JVM

2009-07-17 Thread Bradbev
On Jul 16, 12:58 am, Christian Vest Hansen karmazi...@gmail.com wrote: I haven't tried to look beyond the JIT to see what it does, so I wouldn't know which tools to use, but if you do not already know about it, you might find the HotSpot Internals wiki to be an interesting source of

Re: Experiment with named args

2009-07-17 Thread Laurent PETIT
Hi, 2009/7/17 Mark Addleman mark_addle...@bigfoot.com On Jul 16, 11:50 pm, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/7/17 Mark Addleman mark_addle...@bigfoot.com The sufficiently smart compiler argument comes to mind: if the arglist of a function is known, then surely

Re: Experiment with named args

2009-07-17 Thread Laurent PETIT
2009/7/17 Chouser chou...@gmail.com On Fri, Jul 17, 2009 at 11:21 AM, Mark Addlemanmark_addle...@bigfoot.com wrote: On Jul 17, 2:35 am, Nicolas Oury nicolas.o...@gmail.com wrote: Hello, Can this construct handle higher-order functions? Nope :) Chouser brought up this point in

Re: comment macro not ignoring contents

2009-07-17 Thread Richard Newman
(I once tried to write a reader macro for CL which would do this, but the best I got was one which would read two forms and ignore the first.) The usual technique in Common Lisp is cl-user(1): (list 1 2 #+(or) 3 4) (1 2 4) You can improve readability by using #+:never or somesuch, but that

Re: Experiment with named args

2009-07-17 Thread Chouser
On Fri, Jul 17, 2009 at 12:17 PM, Laurent PETITlaurent.pe...@gmail.com wrote: 2009/7/17 Chouser chou...@gmail.com On Fri, Jul 17, 2009 at 11:21 AM, Mark Addlemanmark_addle...@bigfoot.com wrote: On Jul 17, 2:35 am, Nicolas Oury nicolas.o...@gmail.com wrote: Hello, Can this construct

Re: How to achieve indirection?

2009-07-17 Thread Adam Smyczek
A maybe related newbie question. How common is it for Clojure to separate the two implementations into different libraries? For example, in an application I create one lib that contains just the data for the app (app.data) and two other libraries that provide the functions on the data

Re: Very minor problem in the REPL

2009-07-17 Thread John Harrop
On Fri, Jul 17, 2009 at 11:31 AM, Stephen C. Gilardi squee...@mac.comwrote: It looks like somehow you're seeing a very old REPL or it's not the default REPL you get from launching Clojure via clojure.main. I can confirm the described behavior for the enclojure REPL.

Is there a standard function testing if a sequence starts with a sequence

2009-07-17 Thread samppi
Is there a function in clojure.core or clojure.contrib so that: (and (mystery-fn '(a b c d) '(a b)) (not (mystery-fn '(a b c d) '(a b d --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Is there a standard function testing if a sequence starts with a sequence

2009-07-17 Thread Mark Engelberg
On Fri, Jul 17, 2009 at 1:32 PM, samppirbysam...@gmail.com wrote: Is there a function in clojure.core or clojure.contrib so that:  (and (mystery-fn '(a b c d) '(a b))        (not (mystery-fn '(a b c d) '(a b d how about something like: (defn mystery-fn [l1 l2] (every? identity (map = l1

Re: Is there a standard function testing if a sequence starts with a sequence

2009-07-17 Thread samppi
Awesome, thanks for the quick answer. I think that it'd be a useful thing to add to seq-utils or something. :) On Jul 17, 1:41 pm, Mark Engelberg mark.engelb...@gmail.com wrote: On Fri, Jul 17, 2009 at 1:32 PM, samppirbysam...@gmail.com wrote: Is there a function in clojure.core or

Re: Experiment with named args

2009-07-17 Thread Mark Addleman
Chouser - Can you describe definline and how that differs from defmacro? I'm not sure I understand it from reading the docs. On Jul 17, 10:06 am, Chouser chou...@gmail.com wrote: On Fri, Jul 17, 2009 at 12:17 PM, Laurent PETITlaurent.pe...@gmail.com wrote: 2009/7/17 Chouser

Re: How to use vimClojure?

2009-07-17 Thread Dragan Djuric
Thanks! :) On Jul 17, 5:08 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Jul 17, 3:51 pm, Dragan Djuric draga...@gmail.com wrote: I have installed vimClojure and it seems to work, but... how to push the code to the REPL? Ok. Let's see. Step by step... 0. Start ng-server 1. Start

Re: comment macro not ignoring contents

2009-07-17 Thread philip.hazel...@gmail.com
On Jul 17, 1:52 pm, Rich Hickey richhic...@gmail.com wrote: #_ does what you want: user= (list 1 2 #_42 3) (1 2 3) Thanks for pointing that out. I notice this is actually on the reader page - apologies for not looking properly. --~--~-~--~~~---~--~~ You

Re: Is there a standard function testing if a sequence starts with a sequence

2009-07-17 Thread John Harrop
On Fri, Jul 17, 2009 at 4:41 PM, Mark Engelberg mark.engelb...@gmail.comwrote: On Fri, Jul 17, 2009 at 1:32 PM, samppirbysam...@gmail.com wrote: Is there a function in clojure.core or clojure.contrib so that: (and (mystery-fn '(a b c d) '(a b)) (not (mystery-fn '(a b c d) '(a b

Re: binding issue

2009-07-17 Thread Jonathan Smith
On Jul 14, 5:12 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Jul 14, 3:01 pm, bgray graybran...@gmail.com wrote: Ok, so *if* this is intended behavior, what have people been doing to bind variables dependant on other bindings?  I can't be the first to run into this. Just

Loop, Recur, and Binding

2009-07-17 Thread Tim Snyder
I was experimenting with how binding behaves within a loop and found some inconsistent results: (def y 0) (loop [x 0] (println x x) (binding [y (inc y)] (println y y) (if ( x 10) (recur (inc x) The printed lines are what you'd expect: x 0 y 1 x 1 ... x 10 y 11 But if you

let a variable number of bindings

2009-07-17 Thread Rowdy Rednose
How can I lexically bind names like let does in a macro, when names and values for those bindings are passed in? This here works fine when I pass a literal collection: (defmacro let-coll [coll body] `(let ~(vec coll) ~...@body)) user= (let-coll [a 11 b 22] (list b a)) (22 11) Doing the

Text log viewer in clojure updates

2009-07-17 Thread BerlinBrown
Here is an update to my log viewer in clojure. It mostly works on win32 and I hope to get it past an alpha release., but if you are interested in gui applications in clojure, all source is provided. http://code.google.com/p/lighttexteditor/wiki/LightLogViewer If you run it, I will be happy.

Re: let a variable number of bindings

2009-07-17 Thread Meikel Brandmeyer
Hi, Am 18.07.2009 um 05:52 schrieb Rowdy Rednose: How can I lexically bind names like let does in a macro, when names and values for those bindings are passed in? You can't. A macro cannot depend on runtime information (for some suitable definition of runtime information, I know). In a call