Re: Exception calling nth on Sets

2011-08-14 Thread Meikel Brandmeyer (kotarak)
Hi, Am Sonntag, 14. August 2011 18:59:57 UTC+2 schrieb Despite: > > In Clojurescript, calling rand-nth on an empty Set results in an > "Index out of bounds" exception, whereas calling it on an empty Vector > results in nil. > Returning nil for vectors is almost certainly a bug as it should thr

Re: Small bug in clojure.core/bases?

2011-08-14 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 10. August 2011 22:15:48 UTC+2 schrieb Alf: > When calling bases on an inteface it returns an array. Should this not > be a seq? > Would that make a difference? You can pass an array where you'd expect a sequence. Sincerely Meikel -- You received this message because you are

Re: Stanford AI Class

2011-08-14 Thread Robert Levy
Hmm, I don't know if people will ever see Lisp as an "AI Language" though (kidding). My personal experience was that I learned Common Lisp in the context of an AI course in college. I was pretty excited about learning the language, so I read The Little Lisper the summer before taking the course.

Re: Small bug in clojure.core/bases?

2011-08-14 Thread Sean Corfield
On Sun, Aug 14, 2011 at 9:04 PM, Stephen Compall wrote: > I personally favor seqable? as the test for plural return values. > sequential? almost qualifies, but excludes sets.  seq? fails on account of > rejecting even vectors, but you may feel differently. And just to do my usual pitch for the ne

Re: Small bug in clojure.core/bases?

2011-08-14 Thread Stephen Compall
On Wednesday, August 10, 2011 4:15:48 PM UTC-4, Alf wrote: > > Should this not be a seq? That depends on how you interpret the plural ("immediate superclass and direct interfaces") in its docstring. user> (clojure-version) "1.2.1" user> (use 'clojure.contrib.core 'clojure.pprint) nil user> (ppr

Re: is my understanding correct for function "identity"?

2011-08-14 Thread jaime
It's great to hear so many useful responses/tips -- it's really helpful for people who is leaning Clojure, especially for a beginner like me. Thank you all! -:) On Aug 14, 12:45 am, jaime wrote: > I found an interesting function "identity" which will do nothing but > only returns the parameter pa

Re: is my understanding correct for function "identity"?

2011-08-14 Thread jaime
Hey guys, the clojuredocs link seems interesting and a good place for studying/referencing Clojure. :-) On Aug 15, 12:11 am, abp wrote: > I wanted to add the map/cycle sample, then thougt of clojuredocs and > here you go: > >  http://clojuredocs.org/clojure_core/clojure.core/identity > > On 14 Au

is my understanding correct for function "identity"?

2011-08-14 Thread Stephen Compall
While the "use it as an argument" case is important, it can also be useful when writing functions that return functions, when you want to provide a "do nothing" response. In those cases, just don't forget that identity will throw if given ≠1 arguments. -- You received this message because you

Re: reload file in lein

2011-08-14 Thread Dave Ray
This works for me: repl> (use 'foo.core :reload) or :reload-all if deps of the foo.core ns have changed. Also, (load-file) shouldn't be necessary. Cheers, Dave On Sun, Aug 14, 2011 at 8:20 PM, Jay Vyas wrote: > hi guys, Im doing the following development "workflow" > > -> edit a script in vi

reload file in lein

2011-08-14 Thread Jay Vyas
hi guys, Im doing the following development "workflow" -> edit a script in vi -> save -> $> lein repl -> repl>(load-file src/foo/core.clj) repl>(use `foo/core) I wanted to edit the file and reload it without reloading repl. is that possible. ? -- Jay Vyas MMSB/UCHC -- You receive

Re: Stanford AI Class

2011-08-14 Thread Jeff Heon
I think we all agree that Lisp would be ideal for AI, given a medium or long-term exposure, but for an introductory class to varied branches of AI, we could do worse than Python, an easy to read language with various numerical and AI libraries (PyEvolve, for example. http://pyevolve.sourceforge.net

Re: Exception calling nth on Sets

2011-08-14 Thread Mark Engelberg
My guess is that nth (and by extension rand-nth) can't implicitly call seq on the collection because if it did, you'd lose the fast access that vectors provide. So you'll need to call seq on your set before passing it to rand-nth. -- You received this message because you are subscribed to the Go

Re: Example of a real-world ClojureScript web application

2011-08-14 Thread Timothy Washington
Oops, sorry 'bout that. +1 on what you said. Tim On Sun, Aug 14, 2011 at 4:31 AM, pmbauer wrote: > Bit of copyright violation, that. > If you want the Closure e-book, get a licensed copy. We should encourage > legal means of obtaining information rather than post links to hosts that > aren't a

Exception calling nth on Sets

2011-08-14 Thread Despite
In Clojurescript, calling rand-nth on an empty Set results in an "Index out of bounds" exception, whereas calling it on an empty Vector results in nil. ClojureScript:cljs.user> (rand-nth (set [])) "Error evaluating:" (cljs.core.prn (rand-nth (set []))) :as "cljs.core.prn.call(null,cljs.core.rand_n

Re: Problem Running ClojureScript on OpenJDK

2011-08-14 Thread Tzach
I have a similar problem, but I could not solve it like you did: running on Ubuntu 11.04, $JAVA_HOME set to /usr/lib/jvm/default-java, and default-java soft link to java-6-sun Still when I run script/repl, and (require '[cljs.compiler :as comp]) (def jse (comp/repl-env)) (comp/repl jse) CompilerEx

ANN: clj-schulze, a Clojure implementation of the Schulze voting method

2011-08-14 Thread Benjamin Esham
Hi all, I wrote a small library called clj-schulze [1] to implement the Schulze voting method [2]. I'd appreciate any comments you have; I'm particularly interested in knowing whether I'm doing things idiomatically and whether this library is laid out properly to be used by others. [1] https://gi

Re: Stanford AI Class

2011-08-14 Thread Paulo Pinto
Uau! That was a very comprehensive answer. I was not expecting it. Please note that you don't need to argue for Lisp to me, I also enjoy the language quite much. Unfortunately the closest I get to use Lisp based languages on the job are Emacs and Gimp macros. I cannot sneak Clojure, because on m

Re: is my understanding correct for function "identity"?

2011-08-14 Thread abp
I wanted to add the map/cycle sample, then thougt of clojuredocs and here you go: http://clojuredocs.org/clojure_core/clojure.core/identity On 14 Aug., 00:25, Alan Malloy wrote: > On Aug 13, 12:45 pm, jaime wrote: > > > I found an interesting function "identity" which will do nothing but > > o

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-08-14 Thread Andreas Liljeqvist
Hi, sorry for not reporting back. I did a bit of digging yesterday. Turns out that "sa-jdi.jar" isn't included in JDK6 for windows. Seems like I must use the sharedmemory connector. Also it seems that add-classpath doesn't work on windows? (-> "file:///C:/Program/Java/jdk1.6.0_26/jre/../lib/tool

Re: Stanford AI Class

2011-08-14 Thread Ken Wesson
On Sun, Aug 14, 2011 at 8:50 AM, Paulo Pinto wrote: > I guess that nowadays many AI systems are mainly programmed in > some kind of specialized DSL. > > Sure Lisp based languages are a perfect candidate for it, but the > plain > mention of Lisp brings up some issues that you cannot get rid of, lik

Re: Stanford AI Class

2011-08-14 Thread Paulo Pinto
I guess that nowadays many AI systems are mainly programmed in some kind of specialized DSL. Sure Lisp based languages are a perfect candidate for it, but the plain mention of Lisp brings up some issues that you cannot get rid of, like the parenthesis. To be honest, while I was at the university

Re: Why are some Google Closure library files not available in Clojurescript?

2011-08-14 Thread Hubert Iwaniuk
Hi Conrad, You can give a try to my fork: https://github.com/neotyk/clojurescript/tree/35-cl-head And vote on a ticket: http://dev.clojure.org/jira/browse/CLJS-35 I'm using local storage as well as websockets. Cheers, Hubert. On Aug 12, 2011, at 8:34 PM, Conrad wrote: > In case anyone wants t

Trouble embedding clojurescript in server application

2011-08-14 Thread kjeldahl
I've tried getting clojurescript to run in both my own application, and also tested getting it embedded using noir and noir-cljs, but I'm not having much luck. Essentially, whenever the build method gets called, clojurescript outputs the following errors (except for the line starting with "src-dir"

Re: Example of a real-world ClojureScript web application

2011-08-14 Thread pmbauer
Bit of copyright violation, that. If you want the Closure e-book, get a licensed copy. We should encourage legal means of obtaining information rather than post links to hosts that aren't authorized to distribute materials. -- You received this message because you are subscribed to the Google