EDN for Objective-C (iOS/OS X)

2013-02-05 Thread Matthew Phillips
Hello, a quick search of this group, and the web at large, doesn't get any hits for an Obj-C EDN implementation. Is there anyone working on this? If not, I'll likely go ahead and implement a basic subset of the EDN spec for my own needs, which I'd be happy to share. Cheers, Matthew. -- --

Re: Clojure - Python Style suggestion

2013-02-05 Thread Lee Spector
On Feb 5, 2013, at 12:15 AM, Rich Morin wrote: On Feb 4, 2013, at 19:49, deliminator wrote: Long story short: want more people to love lisp? Implement paredit for more editors. +1! -1 Just another data point and YMMV, but I've long loved Lisp and long hated paredit. I do agree, however,

Re: Why is this code so slow?

2013-02-05 Thread Sung Pae
On Sat, Feb 02, 2013 at 06:28:09PM -0800, Alexandros Bantis wrote: Hello all. I'm working through the Project Euler problems in Java, Scala, Clojure (trying to learn all three?!?). I notice that for one particular problem, I use--more or less--a similar algorithm for all three, but the

Re: Clojure - Python Style suggestion

2013-02-05 Thread Shouxun Yang
When I taught myself Scheme and Common Lisp more than ten years ago, I didn't have any problem with the parentheses, probably because I just learned a little bit of C/C++ or Pascal (Delphi) and were eager to learn Emacs (one of the two major editors in the Unix/Linux world) when I switched to the

constructing matrix-like structures with list-comprehension

2013-02-05 Thread Jim foo.bar
Hi all, I 'm a bit confused with this - I'm trying to think but I can't!!! Probably cos I've not had any food yet! Up till now I thought I could construct matrices with 'for'...So (for [i (range 3)] i) gives us a 1d structure (a list)... (for [i (range 3) j (range 4)] [i j]) gives us a 2d

Puzzle with lazy sequences

2013-02-05 Thread N8Dawgrr
If the head is retained on a lazy sequence we have a potential memory leak. I set my JVM memory low, 64mb and ran the following: user (defn test1 [coll] (reduce + coll)) #'user/test1 user (test1 (take 1000 (iterate inc 0))) 499500 user Now if we do: user (defn test2 [coll]

Re: constructing matrix-like structures with list-comprehension

2013-02-05 Thread Jim foo.bar
I do hate writing code on thunderbird!!! '( counts 1)' should obviously be '( ~counts 1)'... Jim On 05/02/13 15:03, Jim foo.bar wrote: Hi all, I 'm a bit confused with this - I'm trying to think but I can't!!! Probably cos I've not had any food yet! Up till now I thought I could

Re: Puzzle with lazy sequences

2013-02-05 Thread Herwig Hochleitner
Clojure has a feature called locals clearing, which sets 'coll to nil before calling reduce in test1, because the compiler can prove it won't be used afterwards. In test2, coll has to be retained, because reduce is called a second time on it. 2013/2/5 N8Dawgrr nathan.r.matth...@gmail.com If

Re: Puzzle with lazy sequences

2013-02-05 Thread Jim foo.bar
Couldn't the compiler infer that the 2 expressions are identical with identical arguments and perform the reduce only once? Basically what the programmer would do in a let statement? Would that be too expensive? Jim On 05/02/13 15:21, Herwig Hochleitner wrote: Clojure has a feature called

Re: Puzzle with lazy sequences

2013-02-05 Thread N8Dawgrr
Hi Thanks for the super fast response, Still a little confused. If coll is set to nil before reduce is called, then what is reduce called with? On Tuesday, February 5, 2013 3:21:14 PM UTC, Herwig Hochleitner wrote: Clojure has a feature called locals clearing, which sets 'coll to nil before

leiningen checkout dependencies

2013-02-05 Thread Taylor Sando
I have a main project and a subproject and I'm trying to get them to work together. I created the checkouts folder in the main project, and made a symlink to the subproject in it. I use lein repl in the main project, and then I make a (require 'subproject.ns). It works in the sense that it's

Re: [ANN] oauth-clj

2013-02-05 Thread r0man
When I started this library I wanted something that was based on clj-http and the concept of middleware. At that time Matt's library was not based on clj-http yet. But this has changed ... On Tuesday, February 5, 2013 6:37:13 AM UTC+1, Leonardo Borges wrote: Nobody ever replied to this and I'm

Re: Hooking into doc and source

2013-02-05 Thread Phillip Lord
So, I really would like to hook into the doc function so that I can return a documentation string pulled directly from the underlying Java object; I already have a function for doing this, but do not know how to get the native Clojure facilities to call this, rather than just take the

ANN: Tawny-OWL 0.9

2013-02-05 Thread Phillip Lord
Tawny-OWL is a clojure library which provides a DSL for the construction of OWL Ontologies (http://www.w3.org/2004/OWL/). The practical upshot of this, is that allows a form of logic reasoning over sets of facts about the world, with strong computational guarantees about decidability. At it's

Re: ANN: Tawny-OWL 0.9

2013-02-05 Thread Michael Klishin
2013/2/5 Phillip Lord phillip.l...@newcastle.ac.uk Although, it's been available for a while, this is the first release that I have announced here. I'd welcome feedback. Phillip, Please add dependency (artifacts) information to the README. Otherwise beginners won't be able to use your

Re: Puzzle with lazy sequences

2013-02-05 Thread Timothy Baldridge
Hi Thanks for the super fast response, Still a little confused. If coll is set to nil before reduce is called, then what is reduce called with? Remember, the JVM is a stack machine (before the JIT is run). So the code produced is something like this: push coll push nil pop-into coll call-fn

Re: ANN: Tawny-OWL 0.9

2013-02-05 Thread AtKaaZ
you can release that on LGPL License ? does that work with the EPL of clojure ? or is it only an issue when lein uberjar-ed ? On Tue, Feb 5, 2013 at 5:57 PM, Phillip Lord phillip.l...@newcastle.ac.ukwrote: Tawny-OWL is a clojure library which provides a DSL for the construction of OWL

Re: Inflection on clojure.java.io/reader and writer

2013-02-05 Thread Kanwei Li
That's funny, I did exactly the same thing and wrote BufferedReader for both. DOH! Although I have no idea how the internals of type hinting is, I do think it's peculiar that there doesn't seem to be type error checking, even though we are explicitly defining the type. I would feel like it

Re: Inflection on clojure.java.io/reader and writer

2013-02-05 Thread AtKaaZ
*I would love it if it would be* at least a warning if not even better *an error*, but I feel it wouldn't be idiomatic clojure to err, but to warn would maybe be accepted... On Tue, Feb 5, 2013 at 6:34 PM, Kanwei Li kan...@gmail.com wrote: That's funny, I did exactly the same thing and wrote

Re: leiningen checkout dependencies

2013-02-05 Thread Phil Hagelberg
Taylor Sando writes: I tried adding the sub project to the :dependencies in the main project's project.clj, but then all I get is an error that it can't resolve the dependencies of the subproject, because it can't find it. How do I get the main project to resolve the dependencies for the sub

Re: Clojure - Python Style suggestion

2013-02-05 Thread John Jacobsen
Having written Python code professionally for about 7 years and taken to Clojure as a serious hobby for a year and a half, I have thought a lot about the differences between the two languages. While parens provide simple and powerful homoiconicity (and they have a somewhat pleasing aesthetic

Must pass a garbage param to clj-oauth/request token, only in REPL

2013-02-05 Thread lrrrgg
In REPL: (oauth/request-token consumer http://localhost:3000/callback/twitter;) IllegalArgumentException No value supplied for key: http://localhost:3000/callback/twitter clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89) If I do: (oauth/request-token consumer

Re: leiningen checkout dependencies

2013-02-05 Thread Taylor Sando
That worked, thanks. -- -- 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 posts from new members are moderated - please be patient with your first post. To unsubscribe from this

Re: constructing matrix-like structures with list-comprehension

2013-02-05 Thread Jim - FooBar();
Ok, I think I cracked it but as usual someone else might come up with a cleaner approach...:-) (defn matrix [dim dim-lengths] {:pre [(not (nil? dim))]} ;;cannot accept (let [bindings (map #(vector (gensym) `(range ~%)) dim-lengths) symbols (mapv first bindings) counts (inc

Re: Clojure - Python Style suggestion

2013-02-05 Thread Stefan Kamphausen
A simple workaround I've considered, but haven't gotten around to doing anything about in e.g. Emacs, is to simply tone down the parens visually in the editor. Hierarchy of color, size, contrast, etc. matters a lot in perception, and by making the parens slightly less obvious visually

Re: Inflection on clojure.java.io/reader and writer

2013-02-05 Thread Softaddicts
You are not defining a type here. A type hint is just that... a hint so the compiler can optimize the code it generates to call the readLine method on this specific object class. As an example, if io/reader returned an object of a different class at runtime than BufferedReader, it would not fail

Re: [ANN] oauth-clj

2013-02-05 Thread Leonardo Borges
Thanks for the answer Roman! In the end I went with Matt's lib purely based on the number of stars and forks - so far so good. Cheers, Leonardo Borges www.leonardoborges.com On Wed, Feb 6, 2013 at 3:25 AM, r0man roman.sche...@burningswell.com wrote: When I started this library I wanted

Re: Puzzle with lazy sequences

2013-02-05 Thread Herwig Hochleitner
Me: No Well, actually Ambrose of core.typed has proposed an interface to let the compiler know about type information. That seems to make it conceivable to mark functions as pure, hence, implement the optimization you proposed, Jim. Sorry if my first response sounded a tad negative, btw

Re: EDN for Objective-C (iOS/OS X)

2013-02-05 Thread Herwig Hochleitner
According to the Implementations page of the edn wiki [1], libclj [2] seems to be a possible starting point for that plan. [1] https://github.com/edn-format/edn/wiki/Implementations [2] https://github.com/brandonbloom/libclj 2013/2/5 Matthew Phillips mattp...@gmail.com Hello, a quick search

Re: Clojure - Python Style suggestion

2013-02-05 Thread Herwig Hochleitner
2013/2/4 Sergey Didenko sergey.dide...@gmail.com My point is to introduce a second-class syntax to attract orthodox users. Definitely not migrating. OK, I can see how I missed that point. I would say then: go ahead, transform a couple of clojure source files to that style and see, if you can

Re: Clojure - Python Style suggestion

2013-02-05 Thread Softaddicts
Orthodox synonyms: according to the book, acknowledged, admitted, approved, authoritative, buttoned-down, by the numbers, canonical, conformist, conservative, conventional, correct, customary, devout, die-hard, doctrinal, established, in line, legitimate, official, old-line, pious, proper,

Possible bug in clojure.java.jdbc

2013-02-05 Thread alex
Hey all, I've been using clojure.java.jdbc to write a simple database app. When I use the `update-or-insert-values` function, I get an SQLException thrown whenever my column names have special characters in them (like a space or an ampersand). I think the solution is in line 908: the

Re: Possible bug in clojure.java.jdbc

2013-02-05 Thread Andy Fingerhut
You can create a ticket for java.jdbc here if you wish that describes the problem and what you think will fix it. Then any of the 500+ Clojure contributors can take a shot at fixing it: http://dev.clojure.org/jira/browse/JDBC Andy On Feb 5, 2013, at 7:07 PM, a...@bitlimn.com wrote: Hey

Re: ANN: Tawny-OWL 0.9

2013-02-05 Thread John Gabriele
On Tuesday, February 5, 2013 12:08:43 PM UTC-5, AtKaaZ wrote: you can release that on LGPL License ? does that work with the EPL of clojure ? or is it only an issue when lein uberjar-ed ? LGPL just means that the library itself is copyleft (if you make changes to it, and distribute the

Re: Clojure - Python Style suggestion

2013-02-05 Thread Mikera
Please No!! I don't think it would help newcomers at all - it takes only a few days to get used to s-expressions. Coming from a C/Java world I found significant whitespace in Python to be just as much of a mental leap. And it would cause enormous confusion if two different syntaxes were in

[Typed-Clojure] Where is the definition of All?

2013-02-05 Thread James Xu
e.g. (ann test1 (All [x y] [x y - x])) where is the 'All' defined? -- Github: https://github.com/xumingming Blog:http://xumingming.sinaapp.com Weibo: http://weibo.com/xumingmingt -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: ANN: Tawny-OWL 0.9

2013-02-05 Thread AtKaaZ
Thank you. On Wed, Feb 6, 2013 at 4:52 AM, John Gabriele jmg3...@gmail.com wrote: On Tuesday, February 5, 2013 12:08:43 PM UTC-5, AtKaaZ wrote: you can release that on LGPL License ? does that work with the EPL of clojure ? or is it only an issue when lein uberjar-ed ? LGPL just means

Re: [Typed-Clojure] Where is the definition of All?

2013-02-05 Thread AtKaaZ
without looking, I'm thinking maybe it's like thrown? when using it for the is macro (is (thrown? ArithmeticException (/ 1 0))) where thrown? is not defined anywhere and it only has meaning inside is ( actually it's *(defmethod assert-expr 'thrown? [msg form]* ... ) On Wed, Feb 6, 2013 at 7:02

Re: [Typed-Clojure] Where is the definition of All?

2013-02-05 Thread AtKaaZ
maybe this one: https://github.com/frenchy64/typed-clojure/blob/a5944e7c11fa8fe27a86f781feab63a0d218868f/src/typed/parse.clj#L184 On Wed, Feb 6, 2013 at 7:02 AM, James Xu xumingming64398...@gmail.comwrote: e.g. (ann test1 (All [x y] [x y - x])) where is the 'All' defined? -- Github:

Re: [Typed-Clojure] Where is the definition of All?

2013-02-05 Thread xumingmingv
Ah, thanks AtKaaZ! 在 2013-2-6,下午2:33,AtKaaZ atk...@gmail.com 写道: maybe this one: https://github.com/frenchy64/typed-clojure/blob/a5944e7c11fa8fe27a86f781feab63a0d218868f/src/typed/parse.clj#L184 On Wed, Feb 6, 2013 at 7:02 AM, James Xu xumingming64398...@gmail.com wrote: e.g. (ann

Re: Possible bug in clojure.java.jdbc

2013-02-05 Thread Sean Corfield
Andy's right on process... but as maintainer of clojure.java.jdbc, I have to ask: why on earth do you have column names containing spaces or or other weird characters? That's a serious question: how do you get into that situation? I'm not saying clojure.java.jdbc can't be updated to support it,

Re: Possible bug in clojure.java.jdbc

2013-02-05 Thread alex
@Andy: Sorry, I didn't know the proper channel, I'll post it there. I don't control the column names. They're imported from an excel spreadsheet or assigned by the client I'm writing the app for. From experience, it is certainly *possible*, at least to add these columns. Currently I just have