cond-> variant?

2014-02-11 Thread sean
I use cond-> quite a lot but I find myself often wanting a version that uses predicate functions rather than expressions which would seem more “threaded”. Am I just missing a better way to write these things? For example: (cond-> accounts (empty? accounts) (conj “stuff”)) That just screa

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-11 Thread Ambrose Bonnaire-Sergeant
Hi John, Wow! One thing, if clojure.core.typed is aliases in the current namespace, then the ann* refactor should use that alias. If there is no alias, then use the fully qualified namespace. If the var is referred into the current ns-map, then use the fully qualified namespace or a namespace alia

Re: Korma Sql model not accepting url var

2014-02-11 Thread exel...@gmail.com
Hi Shantanu, Am trying out the diff solutions and will select one and post my results in a couple days. Will likely just use java.jdbc Best, Pardeep. On Feb 11, 2014, at 9:38 PM, Shantanu Kumar wrote: > > Btw, would you recommend using an ORM or straight java.jdbc and if an ORM, > any partic

Re: [$Bounty] Emacs plugin for Typed Clojure

2014-02-11 Thread john walker
I'm still on my first cup, so let me know what you think: https://github.com/johnwalker/typed-clojure-el On Tuesday, February 11, 2014 12:01:36 PM UTC-5, Ambrose Bonnaire-Sergeant wrote: > > Hi, > > I need a relatively straightforward Emacs plugin for Typed Clojure written. > > I'm offering a $2

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Brandon Bloom
> > The other question: is it possible to have two mutually refering deftype > definitions. > Although recursive types makes sense on the JVM, it doesn't necessarily make sense on hosts without an explicit type system in which to resolve the mutual recursion; consider ClojureScript. You don't

Re: Korma Sql model not accepting url var

2014-02-11 Thread Shantanu Kumar
> > > Btw, would you recommend using an ORM or straight java.jdbc and if an ORM, > any particular one you'd recommend? > ORMs are not prevalent in Clojure. You can use java.jdbc (the 0.3.x series or later) with one of the SQL generators (HoneySQL, YeSQL etc) that you like. See what works for y

Re: meta circular clojure

2014-02-11 Thread Di Xu
Hi, lisp in lisp evaluator is the simplest evaluator you can build, because lisp uses list to represent its program, and all lisp dialect provide `read` function, so if you want to build an evaluator, you could just use this function and don't need to do lexical and syntax analysis. This is the po

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Alex Miller
IFn (along with the new clojure.java.api.Clojure class) are the totality of the official Java API for Clojure. I would consider some of the other interfaces you mention to effectively be "SPI" (along with "trait" interfaces like Counted, Seqable, Indexed, etc). If something were going to be add

meta circular clojure

2014-02-11 Thread t x
Hi, With apologies for a soft question: * in SICP, the meta circular evaluator of scheme in scheme (chapter 4) is about a page * in Ansi Common Lisp, there's a lisp in lisp in about half a page * if we took Clojure, and ripped out all the JVM support (i.e. gen-class, proxy, (.javaFunc ..

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Mikera
This is useful information - thanks Alex! Might be worth putting some of this on a Clojure.org page somewhere, perhaps linked to the Java interop section? As someone who quite regularly interfaces to Clojure from Java, it would be useful to make *some* of the interfaces into an official public

Re: Korma Sql model not accepting url var

2014-02-11 Thread exel...@gmail.com
Hi Shantanu, I finally got it working as follows: (defmulti parse-int type) (defmethod parse-int java.lang.Integer [n] n) (defmethod parse-int java.lang.String [s] (Integer/parseInt s)) (defn get-a-member [id] (layout/render "member/profile2.html" {:member (db/get-member-url (parse-int id)

Re: GSoC 2014: org applications now open

2014-02-11 Thread Mikera
On the idea of a workbench / clojurescript integration, I always liked the idea of a Light Table based analytical workbench that could connect to a Clojure-based Incanter server (which might of course be running all the heavy computations on a core.matrix GPU backend..) I don't know enough

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Alex Miller
I'd say there is a range of "public"-ness to the internals of Clojure. - The new Clojure API (clojure.java.api.Clojure) is an official public API for external callers of Clojure. This API basically consists of ways to resolve vars and invoke functions. - For Clojure users in Clojure, pretty much

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread John D. Hume
On Tue, Feb 11, 2014 at 7:32 AM, Phillip Lord wrote: > "John D. Hume" writes: > > Other than the new (and quite minimal) Java API for calling > > Clojure code[1], the details of Clojure's underlying Java classes are > > considered implementation details and could change from release to > release

Re: GSoC 2014: org applications now open

2014-02-11 Thread kovas boguta
I've added a project for data visualization components using Om/React. There are a number of parallel threads that could be neatly resolved using the Om/React model, including better chart support for Incanter, and application-specific visualization. I've done some experiments in this vein and so

Re: a couple questions about counting frequencies of words in a text file

2014-02-11 Thread john walker
No problem. If you haven't already, look at the frequencies implementation, since it's fairly instructive. On Tuesday, February 11, 2014 5:55:15 AM UTC-5, Rob Buhler wrote: > > I did need a doall in my function at one point, but later (must have been > when I moved frequencies in) I removed it a

[$Bounty] Emacs plugin for Typed Clojure

2014-02-11 Thread Ambrose Bonnaire-Sergeant
Hi, I need a relatively straightforward Emacs plugin for Typed Clojure written. I'm offering a $200US bounty. If you would also like to see this, please bump up the $$. If you're interested in claiming, see the bounty page

Re: Where is the rotations function?

2014-02-11 Thread Mars0i
Thanks Ray. That's much nicer than whatever I would have come up with. Maybe the ease of implementing it was the reason rotations went away (if it did). On Tuesday, February 11, 2014 3:49:56 AM UTC-6, Ray Miller wrote: > > I'm not sure if that function exists in a new contrib library, but > i

Re: OT: Enterprise Schedulers

2014-02-11 Thread icamts
Hi Adrian, the answer is more off-topic than the question :) but have a look to Spagic (I'm a member of the developers' team), Mule ESB, Petals ESB or Talend ESB. You may already know Talend as an ETL solution. You'll find tools to define, configure and run instances of services or processes. Mo

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Phillip Lord
"John D. Hume" writes: > On Feb 11, 2014 4:41 AM, "Phillip Lord" > wrote: >> >> Is the only place this is written down is by working reading the >> implementing classes? > > I believe so. Other than the new (and quite minimal) Java API for calling > Clojure code[1], the details of Clojure's unde

Re: Question about Reagent

2014-02-11 Thread Dan Holmsand
On Tuesday, February 11, 2014 12:59:13 PM UTC+1, bob wrote: > I am new to react and reagent, the state is hard coded in the demo and > tutorials, I am not sure how to retrieve data from server side and set to > reagent? > > Reagent doesn't have any explicit support for ajax and the like at all,

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread John D. Hume
On Feb 11, 2014 4:41 AM, "Phillip Lord" wrote: > > Is the only place this is written down is by working reading the > implementing classes? I believe so. Other than the new (and quite minimal) Java API for calling Clojure code[1], the details of Clojure's underlying Java classes are considered im

Question about Reagent

2014-02-11 Thread bob
Hi All, I am new to react and reagent, the state is hard coded in the demo and tutorials, I am not sure how to retrieve data from server side and set to reagent? Thanks -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: GSoC 2014: org applications now open

2014-02-11 Thread Daniel Solano Gómez
Hello, On Sat Feb 8 15:48 2014, Alex Ott wrote: > Hi Avram > > There is discussion in Incanter's issue about this: > https://github.com/liebke/incanter/issues/193 - maybe it would be possible > to implement support for different chart backends - like, D3.js, JavaFX, > etc. > > > > On Sat, Feb

Re: a couple questions about counting frequencies of words in a text file

2014-02-11 Thread Rob Buhler
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 group, send email

Re: a couple questions about counting frequencies of words in a text file

2014-02-11 Thread Rob Buhler
I did need a doall in my function at one point, but later (must have been when I moved frequencies in) I removed it and saw it was no longer necessary. I did not run out of memory, and I was surprised how fast it was, but I was not completely sure if there was an implicit doall that was doing st

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Phillip Lord
Alex Miller writes: > next() should return either the remaining seq or null (think Clojure > function next) > more() should return either the remaining seq or empty list (like Clojure > function rest) > > Inside Clojure, most seqs extend ASeq, which implements more() on top of > the abstract

Re: Where is the rotations function?

2014-02-11 Thread Ray Miller
I'm not sure if that function exists in a new contrib library, but it's trivial to implement: (defn rotations [xs] (take (count xs) (partition (count xs) 1 (cycle xs On 11 February 2014 05:53, Mars0i wrote: > At one time there was a function named "rotations" in clojure.contrib.seq, > and at

Re: Korma Sql model not accepting url var

2014-02-11 Thread Michael Klishin
2014-02-11 12:22 GMT+04:00 The Dude (Abides) : > (GET "/member/:id" [id] (get-the-member id)) id here likely ends up being a string but your Postgres column is an integer. Try (Integer/valueOf id). -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You received this

Re: Korma Sql model not accepting url var

2014-02-11 Thread Shantanu Kumar
Can you post the SQL template (with ? symbols) you are trying to execute? Usually, with PostgreSQL you can specify ?::integer in place of ? to imply that the passed parameter is an integer. Shantanu On Tuesday, 11 February 2014 13:52:54 UTC+5:30, The Dude (Abides) wrote: > > Hi, I'm getting an

Korma Sql model not accepting url var

2014-02-11 Thread The Dude (Abides)
Hi, I'm getting an error calling a record from an id passed via a url using Korma Sql. The error says: org.postgresql.util.PSQLException ERROR: operator does not exist: smallint = character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit typ