Re: Idiomatic parsing of objects from several lines of a text file

2009-08-02 Thread David Plumpton
On Jul 31, 9:42 pm, Lau wrote: > Hey, > > I wanted to do something with Git and Qt, and the result was a project > which never really got off the ground. However its capable of reading > an entire Gitlog into a hash-map in the form {:hash > 129412849 :commit ..} > and so on. Ẃe used it at work to

Re: Idiomatic parsing of objects from several lines of a text file

2009-08-02 Thread David Plumpton
On Jul 31, 8:15 pm, Baishampayan Ghose wrote: > I think David is trying to solve the Github Contest problem > -http://contest.github.com/and not really trying to write a Git client > in Clojure :) Actually no, although that looks pretty fun. --~--~-~--~~~---~--~

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-31 Thread Richard Newman
> I don't know about you, but I personally prefer to only use symbols > that I can actually type. Copying and pasting from Character Map > kind of interrupts flow, if you know what I mean? Heh, yes indeed :) That was the reason behind writing "suppose"! Sure-fire way to turn off Windows use

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-31 Thread Aaron Cohen
I think it's MY C++ background shining through, but I keep reading (ref->commit) as "execute the commit method of the ref datastructure." I'll have to echo the lack of enthusiasm of inputting fancy characters, though the Emacs mode to prettify the display look interesting. Good luck with the conte

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-31 Thread John Harrop
On Thu, Jul 30, 2009 at 9:37 PM, Richard Newman wrote: > I suppose in Clojure we could use a real arrow character, with UTF-8 > available in symbol names... I don't know about you, but I personally prefer to only use symbols that I can actually type. Copying and pasting from Character Map kind

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-31 Thread Lau
Hey, I wanted to do something with Git and Qt, and the result was a project which never really got off the ground. However its capable of reading an entire Gitlog into a hash-map in the form {:hash 129412849 :commit ..} and so on. Ẃe used it at work to provide a better alternative than Gitweb, an

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-31 Thread Baishampayan Ghose
Richard Newman wrote: >> I'm trying to find an idiomatic way to read through a text file (e.g. >> a Git history log) > > Sidenote: I'm hacking on this: > > http://github.com/rnewman/clj-git/tree/master > > I haven't got to commit messages etc. yet -- I'm primarily using git > as a backing stor

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-30 Thread Daniel Lyons
On Jul 30, 2009, at 7:24 PM, Aaron Cohen wrote: > Are you coming from a C or C++ background or is this something lispy > I haven't seen before? I first ran into this in Scheme, where I think its use is somewhat more idiomatic than in CL. As the author observes, it's generally used instead

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-30 Thread Richard Newman
> What is this convention you are using with the -> ? > > Are you coming from a C or C++ background or is this something lispy > I haven't seen before? A fair proportion of Common Lispers do that (though I've witnessed debates about its merit, usually in the context of low-level code where

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-30 Thread Aaron Cohen
What is this convention you are using with the -> ? Are you coming from a C or C++ background or is this something lispy I haven't seen before? -- Aaron On Thu, Jul 30, 2009 at 7:56 PM, Richard Newman wrote: > > On 30 Jul 2009, at 2:26 PM, David Plumpton wrote: > > > I'm trying to find an idio

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-30 Thread Richard Newman
On 30 Jul 2009, at 2:26 PM, David Plumpton wrote: > I'm trying to find an idiomatic way to read through a text file (e.g. > a Git history log) Sidenote: I'm hacking on this: http://github.com/rnewman/clj-git/tree/master I haven't got to commit messages etc. yet -- I'm primarily using git as

Re: Idiomatic parsing of objects from several lines of a text file

2009-07-30 Thread Meikel Brandmeyer
Hi, I would suggest to have a look at fnparse[1]. It's really cool. A commit-log parser might look like this: (def linebreak (alt (conc (opt (lit \return)) (lit \newline)) (lit \return))) (def hex-digit (alt-lit-seq "0123456789abcdef")) (def checksum (semantics (rep+ hex-digit) #(