shorter alternatives for `comp' and `partial'

2010-11-13 Thread Eric Schulte
Hi, I find myself frequently using the `comp' and `partial' functions and while I really enjoy being able to program in a point free style, the length (in characters) of these command names often has the effect of causing what should be a brief statement to span multiple lines. I'm about to begin

Re: (:multiplexing clojure.contrib.sql = nil?)

2010-11-13 Thread Shantanu Kumar
Not sure what you meant by multiplexing? Did you mean "concurrent execution" of SQL statements on the same connection? Regards, Shantanu On Nov 14, 4:00 am, Daniel Bell wrote: > I'm just getting my feet wet w/clojure's sql library, and I got to > wondering---is multiplexing implemented in a libr

Incorrect behaviour for large s-expressions :(

2010-11-13 Thread Robert McIntyre
So my friend and I were screwing around, battling versions of LISP as nerds are wont to do, when I came across this: (eval `(clojure.core/+ ~@(take 1e4 (iterate inc 1 Invalid method Code length 89884 in class file user$eval13607 This is just trying to evaluate + directly on a bunch of argume

Re: Simple Neural Network DSL -- request for feedback

2010-11-13 Thread Ross Gayler
You might also consider using your DSL as a frontend to the Nengo neural simulator (http://nengo.ca). Nengo (which is written in Java) has recently added a Python scripting interface (http://www.frontiersin.org/neuroinformatics/ 10.3389/neuro.11/007.2009/abstract). Nengo has a lot to recommend it

(:multiplexing clojure.contrib.sql = nil?)

2010-11-13 Thread Daniel Bell
I'm just getting my feet wet w/clojure's sql library, and I got to wondering---is multiplexing implemented in a library somewhere? Or is it already part of contrib.sql but executed behind the scenes? Thanks, ---Dan -- You received this message because you are subscribed to the Google Groups "C

Re: Newbie question on defstructs

2010-11-13 Thread garf
yeah, I think records are the best approach, but I just struggle with them. Unfortunately I need an article or 2 on these to really get them. Last time I tried I was pretty unsuccessful. On Nov 13, 11:41 am, Chris Maier wrote: > Another approach would be to use records and protocols: > > (defpr

Re: Newbie question on defstructs

2010-11-13 Thread garf
thanks Michel, the more realistic form was quite a bit longer, but i will show just a piece of my (mis)direction (defstruct Ruleform-struct :rname :rule-seq :if-cnt :then-cnt ) (defn rule-if-names [{:keys [ rule-seq if-cnt ] :as ruleform } ] ; (Camoflage Spotted Cover Action Use-Cover

Re: Printing a table of data

2010-11-13 Thread Justin Kramer
print-table was actually just added to the master branch: https://github.com/clojure/clojure/commit/826ff8486fb3e742cea80ebc43d93afbd85b52d9 Justin On Nov 13, 1:02 pm, Shantanu Kumar wrote: > Does anybody know if a standard 'print-table' kind of function exists > in some library? Maybe if someb

Re: Error in 1.3 alpha 3 - "Only long and double primitives are supported"

2010-11-13 Thread Michel Alexandre Salim
On Mon, 08 Nov 2010 14:14:16 -0500, lprefontaine wrote: > Sticking to long and double gets away from Java semantic but it is done > to improve numeric performances. You can actually hint in 1,3 on the > return type of a function to avoid automatic boxing and have your code > work entirely with a "

Re: Being "not Lisp" is a feature?

2010-11-13 Thread Michel Alexandre Salim
On Tue, 09 Nov 2010 12:08:35 -0500, David Sletten wrote: > I don't want to start any language wars, but this is funny: > http://gosu-lang.org/comparison.shtml > I love the part where it claims Scala has "solid IDE tooling". Ever since 2.8.0 comes out the Eclipse plugin auto-completion is broken.

Re: Being "not Lisp" is a feature?

2010-11-13 Thread Michel Alexandre Salim
On Thu, 11 Nov 2010 06:01:55 -0800, Shantanu Kumar wrote: > And then comes this (Paul Stadig's tweet, RT by Stuart Sierra :) > > http://language-comparison.s3.amazonaws.com/comparison.html > >> Not Not Lisp (Ruby/Python/Java) Though actually, in Lisp dialects double-negation of something is ju

Re: Simple Neural Network DSL -- request for feedback

2010-11-13 Thread Eric Schulte
#+begin_src clojure (let [n {:phi identity :accum (comp (partial reduce +) (partial map *)) :weights [2 2 2]}] [(repeat 3 n) (repeat 5 n) (assoc n :weights (vec (repeat 5 1)))]) #+end_src would result in the following connection pattern [[file:/tmp/layers.png]] > Howe

Re: Printing a table of data

2010-11-13 Thread Michel Alexandre Salim
On Sat, 13 Nov 2010 10:02:59 -0800, Shantanu Kumar wrote: > Does anybody know if a standard 'print-table' kind of function exists in > some library? Maybe if somebody can give an example of printing a table > using cl-format or pprint. > What is your table's representation? If it's CSV perhaps yo

Slogan help

2010-11-13 Thread David Sletten
This is kind of a silly question, but I found this in my Clojure notes from last year: Contemporary Lisp Optimized for the JVM: Un- Restricted Expressiveness I can't remember whether I created it or I found it somewhere... Has anyone seen this phrase before? I can't find it on Google. Have all

Printing a table of data

2010-11-13 Thread Shantanu Kumar
Does anybody know if a standard 'print-table' kind of function exists in some library? Maybe if somebody can give an example of printing a table using cl-format or pprint. Regards, Shantanu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: Newbie question on defstructs

2010-11-13 Thread Chris Maier
Another approach would be to use records and protocols: (defprotocol HasCees (c [this] "Returns a 'c'")) (defrecord Foo [a b] HasCees (c [this] (+ (:a this) (:b this Now, to use it: user> (def my-foo (Foo. 1 2) #'user/my-foo user> (c my-foo) 3 This is practically a drop-in replac

Re: Newbie question

2010-11-13 Thread Miki
> Which natural language processing tools have you used that worked well with   > clojure? I haven't personally, but heard someone saying he successfully used clojure-opennlp. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Oracle and Apple announce OpenJDK support for Mac

2010-11-13 Thread Michel Alexandre Salim
On Fri, 12 Nov 2010 10:19:38 -0500, Steve Miner wrote: > Apple made some news during the Clojure Conj by announcing that Java > support from Apple was being deprecated. The good news today is that > Oracle will deliver future updates of Java on the Mac. I think it's > safe to say that the Mac re

Re: Mobile Clojure

2010-11-13 Thread Michel Alexandre Salim
On Sat, 13 Nov 2010 17:34:00 +0600, Petr Gladkikh wrote: > If you do not need to load Clojure code at > run-time, then, I suppose, performance difference would be about the > same as Java vs Clojure on JVM. Nah, the slowness is actually due to the typical Clojure program generating lots of ephem

Re: Newbie question on defstructs

2010-11-13 Thread Michel Alexandre Salim
On Sat, 13 Nov 2010 06:31:03 -0800, garf wrote: > If I have a struct whose creation will require some function calls that > references some of its members, I am unsure how to go about it in a > clean way. For example: > (defstruct tz :a :b :c) > > (def tz1 1 2 (+ (:a tz1) (:b tz1)) > Could

Re: Newbie question on defstructs

2010-11-13 Thread garf
thank you! It seems so obvious now On Nov 13, 10:38 am, Benny Tsai wrote: > One way you could do it is by building up the members incrementally > via 'let': > > (defstruct tz :a :b :c) > > (def tz1 (let [a 1 >                b 2 >                c (+ a b)] >            (struct tz a b c))) > > On

Re: Newbie question on defstructs

2010-11-13 Thread Benny Tsai
One way you could do it is by building up the members incrementally via 'let': (defstruct tz :a :b :c) (def tz1 (let [a 1 b 2 c (+ a b)] (struct tz a b c))) On Nov 13, 7:31 am, garf wrote: > If I have a struct whose creation will require some function ca

Newbie question on defstructs

2010-11-13 Thread garf
If I have a struct whose creation will require some function calls that references some of its members, I am unsure how to go about it in a clean way. For example: (defstruct tz :a :b :c) (def tz1 1 2 (+ (:a tz1) (:b tz1)) will not work, but reflects the problem. Ideally at the end of this

Re: Mobile Clojure

2010-11-13 Thread Petr Gladkikh
On Thu, Nov 11, 2010 at 5:49 AM, Glen Rubin wrote: > Are there any mobile platforms that clojure runs well on?  I saw that > clojure is available for Android, but runs very slowly. There are some hacks (discussed on this list a while ago, IIRC) that convert dalvik code converter to dalvik bytecod