On Thu, Jan 1, 2009 at 10:14 PM, Andrew Baine wrote:
> I want to get a seq of successive rests of the given seq:
> user> (defn f [seq]
> (if (empty? seq)
> nil
> (lazy-cons seq (f (rest seq)
> #'user/f
> user> (f '(1 2 3 4))
> ((1 2 3 4) (2 3 4) (3 4) (4))
Hi,
Haskell has "tails" in the D
On Fri, Jan 30, 2009 at 1:09 PM, Jan Rychter wrote:
> From what I read, the reasoning is that Clojure provides extremely
> general multimethods where you have to define a dispatch function. On
> the object side, there is metadata and you can do with it whatever you
> want. But this seems to leav
On Sun, Mar 22, 2009 at 9:05 PM, Stephen C. Gilardi wrote:
>
> On Mar 22, 2009, at 4:43 PM, Meikel Brandmeyer wrote:
>
>> Is .?. necessary? -> does the same job as .. by
>> virtue of the .method notation, but is more general.
>> So, why not get rid of .. and .?. completely?
>
> That sounds right
I'm not
> sure the signature of a maybe-> monad would be the same as -?>) ?
>
> Regards,
>
> --
> Laurent
>
> 2009/3/23 Graham Fawcett
>>
>> On Sun, Mar 22, 2009 at 9:05 PM, Stephen C. Gilardi
>> wrote:
>> >
>> > On Mar 22, 2009,
On Wed, Nov 18, 2009 at 2:29 AM, Phil Hagelberg wrote:
>
> With Leiningen, your build is described using Clojure. You can put any
> code you like in your project.clj file; the only requirement is that
> it includes a call to defproject. You can define your own tasks in
> there if you need to, but
ingen'ly yours,
Graham
>
> On Nov 20, 11:06 am, Graham Fawcett wrote:
>> On Wed, Nov 18, 2009 at 2:29 AM, Phil Hagelberg wrote:
>>
>> > With Leiningen, your build is described using Clojure. You can put any
>> > code you like in your project.clj file;
Hi folks,
This is somewhat a Java question, but it's in the context of Clojure,
so here goes. Playing with Leiningen got me thinking about bundling a
Clojure application as a JAR, which might include a host of classes
that are loaded but never used. Is it possible to "tree-shake" such a
jarfile, a
On Fri, Nov 20, 2009 at 1:37 PM, Jim Downing wrote:
> Hi Graham
>
> 2009/11/20 Graham Fawcett :
>> Hi folks,
>>
>> This is somewhat a Java question, but it's in the context of Clojure,
>> so here goes. Playing with Leiningen got me thinking about bundling a
On Fri, Nov 20, 2009 at 2:28 PM, Richard Newman wrote:
>> I suppose a better question might be: would a tree-shaker have a
>> reasonable chance of shaking a typical Clojure jar, or are there too
>> many dynamic obstacles to a good analysis.
>
> I'm not sure it's worth solving this through low-leve
On Sat, Nov 21, 2009 at 12:17 PM, Mark Engelberg
wrote:
> Intuitively, it seems to me that what one wants is for lazy data
> structures to contain bound values in some sort of closure-like thing
> so rebindings after the fact don't affect the data structure, but
> regular functions should retain t
On Sat, Nov 21, 2009 at 4:37 PM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 21.11.2009 um 05:22 schrieb Mark Engelberg:
>
>> Which reminds me, every once in a while I see people talking about
>> this here, and brainstorming up some alternatives to binding that
>> might interact better with lazy data st
Hi Jim,
On Tue, Nov 24, 2009 at 11:21 PM, jim 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 in the meanti
On Wed, Dec 2, 2009 at 11:29 AM, Dennis wrote:
> Sean,
> I probably did not make it clear, but I am using parse. The second line of
> handle-xml function in my original E-Mail has the parse in it. I then
> iterate over the xml-seq.
Are you familiar with 'zippers'? There is a zipper for xml-seqs
On Wed, Dec 9, 2009 at 11:15 AM, Jarkko Oranen wrote:
> Jeff Dik wrote:
>> The part "Running code at read-time lets users reprogram Lisp's
>> syntax" caught my attention. Is this talking about reader macros? I
>> believe I read that clojure doesn't have reader macros, so would it be
>> more accu
On Thu, Dec 10, 2009 at 9:15 AM, ngocdaothanh wrote:
> Hi,
>
> I want to ask about code arrangement and understandability
> (readability).
>
> Consider this "normal" code:
> x = 1
> ...
> f(x)
> ...
> y = x + 2
> ...
> g(y)
>
> x, f, y, g have the same "abstractness" level, so they are indented to
Hi folks,
To whom should I send a pull-request for an enhancement for
clojure.contrib.sql? I see that scgilardi is listed as the author, but
I'm not very clear on how the contrib community works.
My patch provides an :external key to (get-connection), which lets you
pass in an existing db connect
Hi Steve,
On Thu, Dec 10, 2009 at 4:53 PM, Stephen C. Gilardi wrote:
> Hi Graham,
>
>> To whom should I send a pull-request for an enhancement for
>> clojure.contrib.sql? I see that scgilardi is listed as the author, but
>> I'm not very clear on how the contrib community works.
>
> The contributi
Hi folks,
Does anyone have advice (recipe, blog article, etc.) for building a
servlet WAR based on a Leiningen project?
Is there interest in developing a 'lein war' plugin? I'm a novice at
Ant, WAR, etc., but It seems to me that most of the mechanics are
already present in 'lein uberjar' -- it's
On Fri, Dec 11, 2009 at 11:51 AM, Sean Devlin wrote:
> While we're at it, how 'bout an EAR file?
Never encountered one of those before -- maybe that is a good thing! :)
After a little study, I was able to write a simple servlet, compile it
with Leiningen, and make a WAR using Maven. This might b
On Wed, Dec 16, 2009 at 1:33 PM, samppi wrote:
> I'm using a vector as a stack. I want to apply a function–let's call
> it modify-element, one argument—to the elements from k to (- (count a-
> vector) k).
>
> Right now, I have something like (not tested yet):
> (reduce #(update-in %1 [%2] modify-
On Thu, Dec 17, 2009 at 2:04 AM, Meikel Brandmeyer wrote:
> Hi,
>
> On Dec 16, 10:36 pm, Graham Fawcett wrote:
>
>> Not sure it's better, but I find this more readable:
>>
>> (defn stack-apply [n f stack]
>> (if (zero? n)
>> stack
On Mon, Dec 21, 2009 at 6:07 PM, Gabi wrote:
> The problem with is that I need to execute the same function with
> different bindings each time. So caching won't help me
> For example I need to do something like:
>
> (dotimes [_ 1000]
> (intern 'user 'x (rand))
> (eval '(prn (+(* x x) 5
So
Hi Richard,
On Wed, Dec 23, 2009 at 5:31 PM, Richard Newman wrote:
> I just started using Proxool, and c.c.sql doesn't offer a way to
> either pass in a connection object, or to construct a JDBC URI that
> starts with anything but 'jdbc:'.
>
> Here's a patch that allows {:connection } as a valid
Hi Alex,
On Wed, Jan 6, 2010 at 9:06 AM, Alex Ott wrote:
> Hello all
>
> I have question about processing big XML files with lazy-xml. I'm trying to
> analyze
> StackOverflow dumps with Clojure, and when analyzing 1.6Gb XML file with
> posts, i get java stack overflow, although i provide enough
Hi,
On Mon, Jan 11, 2010 at 8:44 PM, Steven E. Harris wrote:
> Konrad Hinsen writes:
>
>> For a function of a single argument, m-lift and m-fmap are equivalent.
>
> In Jim Duey's essay Higher Level Monads¹, he writes the following on the
> lift operator:
>
> ,[ m-lift ]
> | If you have a fun
Hi,
On Wed, Jan 13, 2010 at 1:30 AM, Manish wrote:
> Thanx for ur response,
> Actually We are using string builder in our project, String Builder
> causing the memory leak in as I google, Thats the main reason i want
> to set the StringBuilder object to nil,
> We are using the htmlunit core js li
Hi Antony,
On Wed, Apr 7, 2010 at 8:07 PM, Antony Blakey wrote:
>
> I've just pushed a major update to the Clojure support in pmaven to
> http://github.com/sonatype/polyglot-maven. It now covers 100% of
> maven by reflecting over the maven object model. Examples are in the
> tests and in the read
Hi Antony,
On Fri, Apr 9, 2010 at 11:10 AM, Antony Blakey wrote:
>
> On 10/04/2010, at 12:24 AM, Graham Fawcett wrote:
>
>> Your building/installation instructions are a bit on the terse side,
>> and left this Maven newbie in trial-and-error-land. :)
>
> I haven'
On Wed, Aug 27, 2008 at 4:39 AM, Parth Malwankar
<[EMAIL PROTECTED]> wrote:
> After some more experimentation I found that the field-write
> macro didn't work with access-specs like (vector :a :b :c)
> ... I should have thought of that before.
>
> So I reimplemented field-read and field-write as f
On Fri, Aug 29, 2008 at 2:29 PM, noahr <[EMAIL PROTECTED]> wrote:
>
> 1) What's a good way to add to the end of a list?
>
> You could reverse it then cons then reverse it again
> You could convert to vector and use (conj.. or some such
>
> Both of the above seem very kludgey
Hi,
Appending to a l
On Fri, Aug 29, 2008 at 3:41 PM, Graham Fawcett
<[EMAIL PROTECTED]> wrote:
> Appending to a list is kludgey in general. Clojure's PersistentLists
> are singly-linked lists (like Lisp's cons cells), and appending onto
> their tails is O(n) because the entire list must b
On Wed, Oct 15, 2008 at 8:21 AM, Jim Menard <[EMAIL PROTECTED]> wrote:
>
> On Wed, Oct 15, 2008 at 7:46 AM, Timothy Pratley
> <[EMAIL PROTECTED]> wrote:
>>
>> Can I get some help with (map f coll)...
>>
>> What I want to do is map a java function that takes 2 arguments over a
>> list
>> where the
Windsor, Ontario, Canada. (Just down the road, Mark!)
Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this gr
Just for kicks, I made a publically-editable Google map of Clojure
users. I've put my pin on the map, feel free to add your own.
This is my first attempt at such a thing -- hopefully it works!)
http://tinyurl.com/5kl68p
Graham
--~--~-~--~~~---~--~~
You received
On Fri, Oct 17, 2008 at 10:03 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Friday 17 October 2008 06:44, Graham Fawcett wrote:
>> Just for kicks, I made a publically-editable Google map of Clojure
>> users. I've put my pin on the map, feel free to add you
On Mon, Oct 27, 2008 at 11:38 PM, Islon <[EMAIL PROTECTED]> wrote:
> Is there any chance closure will get string interpolation?
>
> Do things like (prn "Hi ${someone}, my name is ${myname}") is nice, not
> crucial of course, but nice.
I'm personally not fond of string interpolation either.
But f
On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett
<[EMAIL PROTECTED]> wrote:
> But for fun, here's an (i ...) macro, that will give you ${}
> interpolation in strings (if it works at all, I test it very
> thorougly!).
Haha, nor did I spell- or grammar-check very thoroughly!
I
(replaceAll "\\$\\{"
> "\\${"))])
> textposns)
> (map (fn [[a b]] [:pat (.substring s (+ a 2) (- b 1))])
> positions
>
> Regards,
>
> Kyle Burton
>
>
>> On Oct
On Wed, Oct 29, 2008 at 2:29 PM, samppi <[EMAIL PROTECTED]> wrote:
>
> Is there a way to test an object if it's a certain kind of struct?
>
> (defstruct person :name :age)
> (def president (struct person "Sam" 30))
> (struct? person president) ; true
Hi,
Defstruct doesn't define a new type in
On Sun, Nov 2, 2008 at 6:34 PM, Mark McGranaghan <[EMAIL PROTECTED]> wrote:
>
> I really like being able to find and check documentation in the REPL
> with find-doc and doc, but I often would like to see the source code
> of a function or macro to be able to understand it better or learn
> from th
On Tue, Nov 4, 2008 at 10:00 AM, Christian Vest Hansen
<[EMAIL PROTECTED]> wrote:
>
> On Tue, Nov 4, 2008 at 3:12 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>> On Nov 4, 9:00 am, "Christian Vest Hansen" <[EMAIL PROTECTED]>
>> wrote:
>>> "Generally" by custom but not required by contract of the Com
On Wed, Nov 5, 2008 at 12:56 PM, Stuart Halloway
<[EMAIL PROTECTED]> wrote:
>
> (1) Is there a simpler way to define pairwise, which takes an existing
> sequence and then returns its items a pair at a time?
>
> (defn pairwise [& seq]
> (map vector (take-nth 2 seq) (take-nth 2 (rest seq
The b
On Wed, Nov 5, 2008 at 12:53 PM, Matthias Benkard <[EMAIL PROTECTED]> wrote:
>
> On Nov 5, 3:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> Are you sure? You're not modifying the clojure source, so you're not
>> creating a derivative work. I would think you can create a GPL
>> licensed
On Wed, Nov 5, 2008 at 2:00 PM, Stuart Halloway
<[EMAIL PROTECTED]> wrote:
>
> Duh. Thanks, and I will be adding that to the sequences chapter. :-/
>
> Stuart
You're welcome -- looking forward to the book!
Best,
Graham
>
>>
>> On Wed, Nov 5, 2008 at 12:56 PM, Stuart Halloway
>> <[EMAIL PROTECT
On Fri, Nov 7, 2008 at 12:25 AM, cwyang <[EMAIL PROTECTED]> wrote:
> My expectation is these:
> 1) For C10K problem (or C100K), application must not use
> native threads. Big stack size means low concurrency
Hi,
I assume you mean 'new native thread per request' is bad for CnK.
Clojure's thread-
On Fri, Nov 7, 2008 at 11:46 AM, vdm <[EMAIL PROTECTED]> wrote:
>
> Is there a way to make Clojure print the svn revision it was compiled
> from? A standard or idiomatic way to do this (print clojure--svn-rev)
> would help when trying to isolate whether observed behaviour is
> happening on old or
On Fri, Nov 7, 2008 at 1:15 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
>
>
> On Nov 7, 1:02 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote:
>> On Fri, Nov 7, 2008 at 11:46 AM, vdm <[EMAIL PROTECTED]> wrote:
>>
>> > Is there a way to
On Fri, Nov 7, 2008 at 1:48 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Fri, Nov 7, 2008 at 1:02 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote:
>>
>> If Rich would be willing to add this to boot.clj,
> [snip]
>>
>> ...then (clojure-svn-revision) ought
On Fri, Nov 7, 2008 at 2:25 PM, Daniel Renfer <[EMAIL PROTECTED]> wrote:
>
> This wouldn't work if someone is using a mirror of the repository
> using a different SCM.
No, but it would still include the upstream SVN revision number.
Alas, what I thought was possible with SVN hooks appears to be
Hi,
On Sat, Nov 8, 2008 at 11:20 AM, verec
<[EMAIL PROTECTED]> wrote:
>
> More of an inquiry into the "fp mindset as opposed to the procedural
> one" than anything else ...
>
> If I got this right, there are two forms of iterations: internal and
> external.
> `map' is an "internal iterator", `dos
HI,
On Sat, Nov 8, 2008 at 2:39 PM, verec
<[EMAIL PROTECTED]> wrote:
> But then why would we want any of `doseq', `dotimes' or `doall', and
> if we do, is that set complete, and with respect to what design
> principle?
Well, given loop/recur as a fundamental iteration form, and doall as a
mecha
On Sat, Nov 8, 2008 at 4:23 PM, verec
<[EMAIL PROTECTED]> wrote:
> Everything that can be interpreted as a `seq', clojure's `doseq' takes
> care of it.
>
> What I am after are the "special cases" for things one could somehow
> enumerate but are not a `seq'.
>
> A number range is one such thing, an
Hi folks,
I haven't been bitten by the "do not use" revisions, R1089 onward, but
it seems that others have.
I'm just curious why the team decided not to use a branch for these
breaking changes, and merging back with trunk once the breakage was
finished?
Like many open-source projects, Clojure s
On Mon, Nov 10, 2008 at 10:33 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
> I'll also add that I didn't check in something that didn't run, just
> something that contains changes that require changes to your code or
> environment. Tracking SVN HEAD certainly implies a willingness to make
> such ch
On Mon, Nov 10, 2008 at 11:15 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Monday 10 November 2008 07:30, Daniel Renfer wrote:
>> There is one thing I would like to point out. My editor of choice,
>> (emacs) uses the length of the function name as a guide of where to
>> indent the next l
On Tue, Nov 11, 2008 at 2:13 PM, Drew Raines <[EMAIL PROTECTED]> wrote:
> I may be missing some philosophical significance of the name
> function, but is there any reason why it can't work on Strings as
> well as Named-s?
Hi,
I think the philosophical point is that a String doesn't have a name,
On Tue, Nov 11, 2008 at 12:59 AM, Daniel Spiewak <[EMAIL PROTECTED]> wrote:
>
> Sounds like you're wasting your time trying to get this working with
> just static HTML pages. I think that it's possible, but you would
> have to do a lot of really nasty javascript hackery to make the button
> targe
On Sat, Nov 8, 2008 at 12:03 PM, Matt Revelle <[EMAIL PROTECTED]> wrote:
>
> If marking SVN revisions and/or release versions is something we still
> want and want automated, it now looks like using the build tool is the
> only way to go. The example I sent earlier to the list includes the
> crea
On Fri, Nov 14, 2008 at 2:37 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
>
>
> On Nov 14, 12:51 pm, "Stuart Sierra" <[EMAIL PROTECTED]>
> wrote:
>> Patch attached. This precompiles everything except parallel.clj,
>> which requires an extra Jar. It also omits the source .clj files from
>> the cl
On Fri, Nov 14, 2008 at 4:01 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
>
> On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote:
>
> I'm sure there's a work-around, of course. The meta information is still
> there:
>
> This appears to be because
Hi,
> Dealing with byte-arrays, you will want to use the write-method that
> takes an array, not the one that takes a string.
>
> Constructing the array is a bit tricky:
>
> ; Define your int
> (def pix 652187261)
>
> ; Define your array, typed as array of char
> (def payload
> (into-array Chara
On Wed, Nov 19, 2008 at 4:49 PM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> On Wed, Nov 19, 2008 at 2:45 PM, prhlava <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hello again,
>>
>> Thank you all for the posts and explanations,
>>
>> After getting the clojure SVN version and few tweaks in the code, the
>>
Hi Vlad,
On Thu, Nov 20, 2008 at 5:36 PM, prhlava <[EMAIL PROTECTED]> wrote:
>
> Hello Graham,
>
>> Bonus question for the bored reader: write a function,
>> (byte-array-maker N), that takes a width N, and returns a function
>> that takes an Integer as input and returns an N-width byte array
>> c
On Fri, Nov 21, 2008 at 8:14 PM, Telman Yusupov <[EMAIL PROTECTED]> wrote:
>
> Toronto, Canada
Another Canadian! The more the merrier. :-)
Just a reminder that I put up a Google map of Clojure users worldwide:
http://tinyurl.com/5kl68p
If you're so inclined, you're invited to take a moment and
64 matches
Mail list logo