Re: partition improvement

2009-05-08 Thread Jason Wolfe
See also "partition-all" in clojure.contrib.seq-utils. It isn't as feature-complete as your version, but is instead a drop-in replacement for "partition" that always returns the final part (regardless of whether or not it's long enough). -Jason On May 8, 4:02 pm, DiG wrote: > Hi all, > > Quite

Add JNDI lookup support for contrib/sql

2009-05-08 Thread Mark Derricutt
Hi, Can we add the following to contrib's sql namespace, it simply adds "jndi" as a db-spec scheme ( I also raised this as http://code.google.com/p/clojure-contrib/issues/detail?id=39 , which google decided to set as a defect and I can't change): Index: src/clojure/contrib/sql/internal.clj ==

Re: Byte Overflow

2009-05-08 Thread tmountain
Ahh, should've looked at the docs. Thanks for the helpful response. Travis On May 8, 11:09 pm, "Stephen C. Gilardi" wrote: > On May 8, 2009, at 10:42 PM, tmountain wrote: > > > > > I'm working on a project that makes use of a lot of byte arrays, and > > I'm having an issue with certain bytes ov

Re: AIML pattern matcher design

2009-05-08 Thread Parth Malwankar
On Fri, 08 May 2009 22:20:13 +0530, dhs827 wrote: > > > ; First thing to learn is XML parsing with Clojure. > > > Other comments, tips, disses? > > Dirk In case you don't expect end users or other languages to access the configuration, one option you have is to save the configuration directly

Re: Launching apps

2009-05-08 Thread Adrian Cuthbertson
For production server systems running under Linux, I've used apache commons daemon to get java apps launched, for example under root to get port 80 and then su'd to run under the app (non-privileged) userid. The advantage is these can be automatically restarted when the server reboots, or services

Re: AIML pattern matcher design

2009-05-08 Thread Adrian Cuthbertson
I found that after a couple of months of working with Clojure, my whole perspective on thinking about the problem domain and its possible abstractions changed really significantly. An approach that might benefit you is to spend a while dabbling with some repl explorations of some of the key Clojur

Re: Byte Overflow

2009-05-08 Thread Stephen C. Gilardi
On May 8, 2009, at 10:42 PM, tmountain wrote: I'm working on a project that makes use of a lot of byte arrays, and I'm having an issue with certain bytes overflowing to negative values. I know they're being stored properly because I'm also generating hex dumps from time to time which indicate t

Re: Help w/ monadic parser

2009-05-08 Thread jim
I'm trying to pack to leave town for a week. I'll try to post something, but Sunday will be the earliest since I'll be spending most of tomorrow in a small metal tube at 20,000 feet in the air. Jim Howard Lewis Ship wrote: > I've been struggling to create a monadic parser. I'm parsing XML > doc

Byte Overflow

2009-05-08 Thread tmountain
I'm working on a project that makes use of a lot of byte arrays, and I'm having an issue with certain bytes overflowing to negative values. I know they're being stored properly because I'm also generating hex dumps from time to time which indicate the real value is there. Can someone tell me how t

Using a monad's m-plus function inside a macro

2009-05-08 Thread samppi
I'm trying to use m-plus inside a macro like this: (defmacro alt [& subrules] (with-monad parser-m `(fn [state#] ((m-plus ~...@subrules) state# Unfortunately, I get the error: No such var: my-namespace.fnparse/m-plus I've been trying various ways, and I think that

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-08 Thread Kevin O'Neill
Tags should now be stable and generate new revisions only when/if the subversion revision changes. -k. On Sat, May 9, 2009 at 6:44 AM, Kevin O'Neill wrote: > yeah  ... tags a a bit of a pain as the tags revision can move > underneath me. i took the conservative (and lazy) approach and update >

Help w/ monadic parser

2009-05-08 Thread Howard Lewis Ship
I've been struggling to create a monadic parser. I'm parsing XML documents into a DOM tree. Step one is to use a SAX parser to create a stream of XML tokens; each a struct map. The token types are :start-element, :attribute, :text and :end-element. Next I'm feeding this list of tokens into a m

Re: HTTP clients in clojure

2009-05-08 Thread André Thieme
On 7 Mai, 02:34, Eric Tschetter wrote: > Last I checked the various clojure libraries, it seemed like noone has > publicized a set of wrappers/clojure-native implementation of an http > client.  I'm wonder if such a thing exists, or has everyone basically > just rolled their own wrapper on top of

Re: CL libraries - Newbie question

2009-05-08 Thread André Thieme
On 8 Mai, 20:00, melipone wrote: > Hiya, > > I understand that you can use Java libraries with Clojure but can you > use Common Lisp libraries for example CXML? In principle you could run Clojure and ABCL inside the same VM. http://common-lisp.net/project/armedbear/ That should allow you to use

Re: Launching apps

2009-05-08 Thread André Thieme
On 9 Mai, 00:30, Chris Dean wrote: > How do folks launch their apps? > > For building (and maybe deploying) it seems that most people use the > Java tools (ant, maven, ivy) or have a 10 line shell script.  For pure > Clojure code you don't even necessarily have to have a build step. > > But how d

Re: Using Map

2009-05-08 Thread André Thieme
On 4 Mai, 17:01, Emeka wrote: > Hello All, > I want to arrange objects in rows and also being able to manipulate them. By > manipulation I meant, I could move one object from one row and use it to > replace another object in another. Should I use Map or something else? I > need your opinions here

Re: Using Map

2009-05-08 Thread Stephen C. Gilardi
On May 8, 2009, at 6:40 PM, James Reeves wrote: Perhaps you could explain in more detail what you intend to do and why? As Luke says, a "row" suggests a vector, rather than a map, but it's difficult to say for sure without knowing what you are trying to achieve. I'm interested in Emeka's answ

Re: Using Map

2009-05-08 Thread James Reeves
On May 8, 8:40 pm, Emeka wrote: > Luke > I was referring to map the data structure. I later decided to use struct > which is a map. I intend to manipulate elements of each row. > > Emeka Perhaps you could explain in more detail what you intend to do and why? As Luke says, a "row" suggests a vect

Launching apps

2009-05-08 Thread Chris Dean
How do folks launch their apps? For building (and maybe deploying) it seems that most people use the Java tools (ant, maven, ivy) or have a 10 line shell script. For pure Clojure code you don't even necessarily have to have a build step. But how do you launch your code in a production style se

Re: partition improvement

2009-05-08 Thread Stephen C. Gilardi
On May 8, 2009, at 5:02 PM, DiG wrote: Quite often one need to get the last part of partition which is smaller than the requested partition size. This change also support another common case where one would like to pad the partition. I like this a lot. One suggestion: Keep "coll" as

partition improvement

2009-05-08 Thread DiG
Hi all, Quite often one need to get the last part of partition which is smaller than the requested partition size. This change also support another common case where one would like to pad the partition. Since it is such a small change I am pasting the whole function, instead of patch, but of cau

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-08 Thread Kevin O'Neill
yeah ... tags a a bit of a pain as the tags revision can move underneath me. i took the conservative (and lazy) approach and update them during the refresh cycle. i might look into improving this a little over the weekend. -k. On Sat, May 9, 2009 at 4:28 AM, Phil Hagelberg wrote: > > "Kevin O'

Re: Question about modifying sexps via macros

2009-05-08 Thread ianp
Hi Meikel, > Please note, that these annotations are wrong. Since > create-form is a macro, container and components refer > to Symbols or some other Clojure structure (depending > on how you pass the later container and map). Thanks for pointing that out, I didn't realise that. Although, now th

Re: Question about modifying sexps via macros

2009-05-08 Thread ianp
Hi Christophe, > hth Yeah, thanks! I'm not sure what I was thinking when I wrote out `~sbody in the above code, thanks for pointing that out. I've got that bit of what I'm trying to do working now, I ended up with code that looks like this: (defmacro sequential [layout & cs] (let [g (gensym "

Re: Using Map

2009-05-08 Thread Emeka
Luke I was referring to map the data structure. I later decided to use struct which is a map. I intend to manipulate elements of each row. Emeka On Fri, May 8, 2009 at 6:17 PM, Luke VanderHart wrote: > > Do you mean map the function or map the data structure? > > If the most natural form of your

Re: CL libraries - Newbie question

2009-05-08 Thread David Nolen
Not unless you port it ;) Between what's in clojure-contrib and the fact that you have full access to Java XML processing libraries you shouldn't have a problem with dealing with XML. Depending on your needs you should also give Enlive a spin. It's like XPath+XSLT but it doesn't suck. On Fri, May

CL libraries - Newbie question

2009-05-08 Thread melipone
Hiya, I understand that you can use Java libraries with Clojure but can you use Common Lisp libraries for example CXML? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: Problems with Kevin O'Neills Clojure GitHub Mirror

2009-05-08 Thread Phil Hagelberg
"Kevin O'Neill" writes: > Branches and tags are now being mirrored. Looks like the release_1.0 tag is getting pushed to every hour. -Phil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: Using Map

2009-05-08 Thread Luke VanderHart
Do you mean map the function or map the data structure? If the most natural form of your data is truly "rows", you're probably best off using a vector data structure. As for which function you use, that depends whether you're doing something to every element or only to specific elements, and if y

Re: AIML pattern matcher design

2009-05-08 Thread Luke VanderHart
> ; First thing to learn is XML parsing with Clojure. This is basically done. Use the xml library in core if you just need to load XML into a map data structure. Use the zip library if you need to navigate it. Use the xml library in contrib if you need to do xpath- style navigation. For the rest

AIML pattern matcher design

2009-05-08 Thread dhs827
I'm stealing knowledge left and right (just ask me :-) to design me an AIML pattern matcher. I've compiled a draft list of objects and behaviors, which I would like to see reviewed for plausibility: startup - opens configuration file (e.g. startup.xml) - passes configuration file

Re: Can "for" be enhanced to not have to take a binding?

2009-05-08 Thread Daniel Lyons
On May 7, 2009, at 4:15 PM, Jarkko Oranen wrote: > Also, how is a lazy sequence of mouse events supposed to work? does it > block? What happens when there is no mouse event? does the sequence > just end? What if you happen to take the last event, and then the > sequence ends, after which another

Re: Clojure Community Geography (The Clojure Map)

2009-05-08 Thread Victor Rodriguez
On Thu, May 7, 2009 at 6:22 PM, Stephen C. Gilardi wrote: ... > If you'd like to add your marker to the list: > >        - open the URL >        - sign in to Google >        - at the upper right of the pane on the left that lists all >          the names, click "edit" >        - on the map, at th

Re: Getting slime-edit-definition to work with Clojure

2009-05-08 Thread Asbjørn Bjørnstad
On May 8, 6:49 pm, Baishampayan Ghose wrote: > Asbjørn Bjørnstad wrote: > > Just speaking for myself, I do this to set up a classpath that > > includes all the third-party jars I've downloaded and use in > > my projects. I did this long time ago and haven't looked at it > > since (Too busy at wo

Re: Getting slime-edit-definition to work with Clojure

2009-05-08 Thread Baishampayan Ghose
Asbjørn Bjørnstad wrote: > Just speaking for myself, I do this to set up a classpath that > includes all the third-party jars I've downloaded and use in > my projects. I did this long time ago and haven't looked at it > since (Too busy at work.) What's the "proper" way of doing > this in a slime

Re: Getting slime-edit-definition to work with Clojure

2009-05-08 Thread Asbjørn Bjørnstad
On Apr 30, 1:47 am, Phil Hagelberg wrote: > > (setq swank-clojure-binary "clojure") > > > (add-to-list 'slime-lisp-implementations > >              '(clojure ("/home/ghoseb/bin/clojure") :init > > swank-clojure-init)) > > It looks like you're using a wrapper script rather than letting > swank-

Re: Getting slime-edit-definition to work with Clojure

2009-05-08 Thread Baishampayan Ghose
Stephen C. Gilardi wrote: > I've simplified my .emacs file and clojure launch script to only what's > required for my slime setup to work with swank-clojure. With this > simplified setup, I confirmed that slime's repl works and that M-. after > typing (+ brings me to the definition of + in clojur