Re: Getting index of char from end

2011-11-13 Thread Andreas Kostler
How about using the clojure sequence functions? (require '[clojure.contrib.seq-utils :as seq-utils]) (defn last-index-of [c string] (first (seq-utils/find-first (fn [[_ a]] (= a c)) (reverse (seq-utils/indexed string) P.S. Jong Won, how are you liking Clojure? I've met you in Parramatta and

Re: Getting index of char from end

2011-11-13 Thread Andreas Kostler
How about using the clojure sequence functions? (require '[clojure.contrib.seq-utils :as seq-utils]) (defn last-index-of [c string] (first (seq-utils/find-first (fn [[_ a]] (= a c)) (reverse (seq-utils/indexed string) P.S. Jong Won, how are you liking Clojure? I've met you in Parramatta and

Re: Downloading the documentation?

2011-11-13 Thread Lars Rune Nøstdal
The Clojure gh-pages branch contains the API docs, but as far as I can tell it doesn't contain the stuff found on clojure.org. -- 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 Note that

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
Hi, Yes, Phil Bagwell presented that at the Conj. I'm really interested in this stuff, so as an exercise in Clojure, I've started thinking about how to implement it. At first I'll try and do it without looking at Scala - if I get stuck I might peek a bit :) If you're interested, I'll put it

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Krukow
By the way, I don''t see it as a replacement for PersistentVector, but rather as an additional data structure, that could perhaps be put somewhere in contrib if it turns out well. /Karl On Nov 13, 9:54 am, Karl Krukow karl.kru...@gmail.com wrote: Hi, Yes, Phil Bagwell presented that at the

Re: A Taste of cKanren (via a coding challenge)

2011-11-13 Thread Jules
Here is a slight modification of the previous program that can be executed in two directions: N = [40] A = range(1,40) B = range(1,40) C = range(1,40) D = range(1,40) def valid(a,b,c,d,n): weights = set(w*a+x*b+y*c+z*d for w in [-1,0,1] for x in [-1,0,1]

Re: A Taste of cKanren (via a coding challenge)

2011-11-13 Thread Laurent PETIT
So, if one stays in the imperative world, why not just the generic problem instead of the specific one ? This clojure solution can solve the problem for any N (total weight) and any M (any number of parts the stone can be spit into): https://gist.github.com/1332020 The implementation is a bit

Re: A Taste of cKanren (via a coding challenge)

2011-11-13 Thread David Nolen
On Sun, Nov 13, 2011 at 10:46 AM, Jules julesjac...@gmail.com wrote: Here is a slight modification of the previous program that can be executed in two directions: N = [40] A = range(1,40) B = range(1,40) C = range(1,40) D = range(1,40) def valid(a,b,c,d,n): weights =

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread David Nolen
This would be awesome. From his talk it sounds like it shouldn't replace PersistentVector at all, in fact you should be able to share structure with PersistentVector right? David On Sun, Nov 13, 2011 at 10:02 AM, Krukow karl.kru...@gmail.com wrote: By the way, I don''t see it as a replacement

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
On 13/11/2011, at 18.14, David Nolen wrote: This would be awesome. From his talk it sounds like it shouldn't replace PersistentVector at all, in fact you should be able to share structure with PersistentVector right? David Yes, I think so. If I understand correctly, one cool thing is

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread David Nolen
You should definitely look at gvec.clj. It's a PersistentVector implementation in Clojure but for the various primitive types. David On Sun, Nov 13, 2011 at 12:38 PM, Karl Krukow karl.kru...@gmail.com wrote: On 13/11/2011, at 18.14, David Nolen wrote: This would be awesome. From his talk it

Re: Downloading the documentation?

2011-11-13 Thread Kyle Cordes
On Sunday, November 13, 2011 at 7:18 AM, Lars Rune Nøstdal wrote: The Clojure gh-pages branch contains the API docs, but as far as I can tell it doesn't contain the stuff found on clojure.org (http://clojure.org). That's how it appears to me also. It is the contents of

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread Karl Krukow
Yeah, I found that one. I'll still go for the Java implementation to start with (also makes it easier to put in clj-ds). Then gvec as a starting point for a Clojure version (if I ever get there :). One thing I was wondering about: there would be quite a bit of code I could reuse verbatim from

clojure-jsr223 and shibboleth ScriptedAttributeDefinition

2011-11-13 Thread Francesco
I was trying to write a simple script attribute definition for shibboleth as in: https://wiki.shibboleth.net/confluence/display/SHIB2/ResolverScriptAttributeDefinition with the help of clojure-jsr223. I included both clojure.jar and clojure-jsr223.jar in classpath and voila my script in

Keeping an SSH tunnel open on Heroku using Clojure

2011-11-13 Thread Dave Barker
Hey Everyone, It might me a mad idea but I've been trying to tunnel out to my database server from Heroku, I've written some code that works locally but I can't get it running on Heroku. Another problem is that even locally the connection seems to time out after a while, I'm trying to keep it

Re: Getting index of char from end

2011-11-13 Thread jongwon.choi
Andreas, how're you doing? Frankly my impression of Clojure is just like this posting. You know usually with Common Lisp my common sense works - it provides more than I expect. With Clojure I have to double check because my expectation is more than Clojure provides, mostly. And it ends up being