Re: SQL Korma Missing Pred

2011-11-08 Thread Chris Granger
0.2.2-SNAPSHOT has that fixed.

On Nov 8, 10:57 am, Dennis Crenshaw  wrote:
> Let me start by saying, I'm loving this SQLKorma, it feels like just the
> right amount of syntax. And there's exec-raw for super fast integration
> into an project with existing SQL statements.
>
> However, while kicking the tires I ran into a weird problem, every
> predicate works except <=, eg:
>
> $=> (select table (where {:id [<= 1]}))
> $=> CompilerException java.lang.RuntimeException: No such var:
> korma.internal.sql/pred-<=, compiling:(NO_SOURCE_PATH:46)
>
> Perhaps I'm missing something but all the rest of the pred-vars are there,
> that specific one is missing. I wanted to ask before I bother someone with
> a ticket.
>
> Thanks,
> Dennis

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN framework.one (MVC web application framework)

2011-11-08 Thread Sean Corfield
On Tue, Nov 8, 2011 at 8:11 PM, jaime  wrote:
> Is there any docs describe the principles/concepts (not only for MVC)
> of this framework??

Yes, the CFML version's wiki should cover that:

>> The original FW/1 documentation is 
>> here:https://github.com/seancorfield/fw1/wiki

If that doesn't cover it, let me know what specifically you're looking for...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj extracurricular activities spreadsheet

2011-11-08 Thread Nick Brown
Drinks + Clojure sounds like a good idea for me.  What time will it
be?

On Nov 5, 10:54 pm, Phil Hagelberg  wrote:
> On Fri, Nov 4, 2011 at 6:16 PM, Michael Fogus  wrote:
> >> Any thoughts about when / where these events can take place?
>
> > At this point it would be great if a Conj-planning heavyweight could
> > step in and provide some additional ideas... although solutions would
> > be great too.  :-)
>
> For what it's worth, the Heroku Drinkup is turning into Drinks at the
> Game Room on Wednesday sponsored by Heroku, so find me or other Heroku
> folks if you're coming in early for a drink ticket.
>
> -Phil

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Confusing interplay between macros and metadata

2011-11-08 Thread Tassilo Horn
Alan Malloy  writes:

Hi Alan,

> I want to typehint the return value of f, so I put metadata on the
> form representing a call to it. But if a macro gets involved, there's
> an "intervening" form that ignores its metadata and returns a new list
> of '(f 10) with no metadata. Thus the compiler has no idea I ever
> wanted to give it a hint about the type.

I'm facing the same issue.  I have this macro for java interop:

--8<---cut here---start->8---
(defmacro with-traversal-context
  [[g tc] & body]
  `(let [old-tc# (.getTraversalContext ^Graph ~g)]
 (try
   (.setTraversalContext ^Graph ~g ^TraversalContext ~tc)
   ~@body
   (finally (.setTraversalContext ^Graph ~g ^TraversalContext old-tc#)
--8<---cut here---end--->8---

But the type hints are gone in the macro expansion, thus I have 3
reflection warnings per macro application, and real, performance
critical reflection warnings get lost in the shuffle.

Is there a way to suppress reflection warnings only in a given scope,
i.e., something like a `do' in whose body no reflection warnings are
issued?

Bye,
Tassilo
-- 
(What the world needs (I think) is not
  (a Lisp (with fewer parentheses))
  but (an English (with more.)))
Brian Hayes, http://tinyurl.com/3y9l2kf

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj extracurricular activities spreadsheet

2011-11-08 Thread Andres Gomez
Im in for wednesdays drinkup and thursdays lighting taks (i would like
to give a 5 -10 min lighting talk)

On Oct 25, 10:11 am, Fogus  wrote:
> All,
>
> We talked about the possibility of getting some ideas about
> extracurricular activities during the Conj days (and possibly training
> days).  I've created a spreadsheet at the link below to collect
> ideas.  It is not my intention to be the organizer of these
> activities.  Instead, if you have an idea then please be prepared to
> own it.  The matter of space for these activities would need to be
> worked out by Conj planners or activity organizers, but having a list
> would help that process.
>
> https://docs.google.com/spreadsheet/ccc?key=0Alim_jfrt24MdDFqZVZsNW0t...
>
> I've entered an example, feel free to add your own ideas. :-)
>
> This should be epic.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: using sqlite3

2011-11-08 Thread Tim Sally
Hi,

>From the cursory glance, it seems Korma supports sqlite3.

http://sqlkorma.com/docs

https://github.com/ibdknox/Korma/blob/master/src/korma/db.clj#L100

Best,

Tim

On Tue, Nov 8, 2011 at 3:47 PM, loonster  wrote:
> After searching long and hard, there really isn't any good
> documentation for using sqlite3 with clojure 1.3.  Any help connecting
> to an existing sqlite3 db and performing selects and updates greatly
> appreciated.   Tim
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: question about cons function

2011-11-08 Thread Dan Filimon
Hi Nicholas!

I think the answer you're looking for is best explained by Michał in this 
StackOverflow post:

http://stackoverflow.com/questions/3008411/clojure-seq-cons-vs-list-conj

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: scheme to clojure translation

2011-11-08 Thread Aquahappy
Hi Jim,

Thanks so much! Using 'def' instead of 'defn' when defining a function
composed of functions was what I was missing.

I can't believe I spent an hour trying to figure this out -- it seems
very obvious now. Doh!

:)

On Nov 8, 6:50 pm, Jim Crossley  wrote:
> Hi
>
> Aquahappy  writes:
>
> [...]
>
> > 1:  (define (compose f g) (lambda (x) (f (g x
> > 2:  (define (twice f) (compose f f))
> > 3:  (define fourth (twice sq))
> > 4:  (fourth 3)
>
> > I've gotten this far and then I get stuck when I try to do line 2 from
> > the above:
>
> > 1:  (defn compose [f g] #(f (g %)))
>
> This is what I came up with. Note I also defined the sq function.
>
> user=> (defn compose [f g] #(f (g %)))
> #'user/compose
> user=> (defn twice [f] (compose f f))
> #'user/twice
> user=> (defn sq [x] (* x x))
> #'user/sq
> user=> (def fourth (twice sq))
> #'user/fourth
> user=> (fourth 3)
> 81
>
> Jim

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: form-zip

2011-11-08 Thread Alan Malloy
(fz-node-seq x) is just (tree-seq coll? seq x) then, yeah? I could see
form-zip being useful for people who like zippers (personally I don't
have enough experience to be comfortable with them), but fz-node-seq
doesn't seem useful.

On Nov 1, 8:56 pm, George Jahad  wrote:
> surely this one's been written before, but i needed it the other day
> and couldn't find it.
>
> form-zip returns a zipper from a clojure form.
>
> user=> (require '[clojure.zip :as zip])
> user=> (use 'form-zip.core)
> user=> (-> '{1 2 3 4} form-zip  zip/next zip/remove zip/root)
> {3 4}
>
> fz-node-seq returns a seq of the nodes.
>
> user=> (fz-node-seq '{1 2 3 4})
> ({1 2, 3 4} [1 2] 1 2 [3 4] 3 4)
>
> a one hour hack, probably full of edge cases i haven't thought of.
>
> on clojars and github:https://github.com/GeorgeJahad/form-zip

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: form-zip

2011-11-08 Thread Alan Malloy
They have a different make-node function, so that when you edit a
vector-zip you get vectors instead of something else. It's also easy
to imagine your "data units" are simple vectors, grouped together in
some kind of list structure. Then you would want the zipper to tell
you "hey, this node is a leaf" for vectors - thus seq-zip.

On Nov 8, 7:21 pm, George Jahad  wrote:
> Now that I think of it, why are seq-zip and vector-zip separate
> functions?  Why not a single function that handles both seq and
> vectors, and sets and maps too?
>
> What am I missing?
>
> On Nov 1, 8:56 pm, George Jahad  wrote:
>
>
>
>
>
>
>
> > surely this one's been written before, but i needed it the other day
> > and couldn't find it.
>
> > form-zip returns a zipper from a clojure form.
>
> > user=> (require '[clojure.zip :as zip])
> > user=> (use 'form-zip.core)
> > user=> (-> '{1 2 3 4} form-zip  zip/next zip/remove zip/root)
> > {3 4}
>
> > fz-node-seq returns a seq of the nodes.
>
> > user=> (fz-node-seq '{1 2 3 4})
> > ({1 2, 3 4} [1 2] 1 2 [3 4] 3 4)
>
> > a one hour hack, probably full of edge cases i haven't thought of.
>
> > on clojars and github:https://github.com/GeorgeJahad/form-zip

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: form-zip

2011-11-08 Thread George Jahad

Now that I think of it, why are seq-zip and vector-zip separate
functions?  Why not a single function that handles both seq and
vectors, and sets and maps too?

What am I missing?

On Nov 1, 8:56 pm, George Jahad  wrote:
> surely this one's been written before, but i needed it the other day
> and couldn't find it.
>
> form-zip returns a zipper from a clojure form.
>
> user=> (require '[clojure.zip :as zip])
> user=> (use 'form-zip.core)
> user=> (-> '{1 2 3 4} form-zip  zip/next zip/remove zip/root)
> {3 4}
>
> fz-node-seq returns a seq of the nodes.
>
> user=> (fz-node-seq '{1 2 3 4})
> ({1 2, 3 4} [1 2] 1 2 [3 4] 3 4)
>
> a one hour hack, probably full of edge cases i haven't thought of.
>
> on clojars and github:https://github.com/GeorgeJahad/form-zip

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Alan Malloy
On Nov 8, 6:46 pm, Alan Malloy  wrote:
> On Nov 8, 4:44 pm, Stuart Halloway  wrote:
> > > This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages 
> > > differ.
>
> > > Consider a trivial project that `uses` midje:
>
> > >    (ns midje-aot.core
> > >      (:use midje.sweet))
>
> > > If it's aot-compiled, everything appears to go well:
>
> > >    1762 $ lein compile
> > >    Copying 6 files to /Users/marick/src/midje-aot/lib
> > >    Copying 1 file to /Users/marick/src/midje-aot/lib/dev
> > >    Compiling midje-aot.core
> > >    Compilation succeeded.
>
> > > But certain of the namespaces can't be loaded:
>
> > > 1766 $ lein repl
> > > REPL started; server listening on localhost port 40437
> > > user=> (require 'midje.semi-sweet)
> > > NullPointerException   clojure.lang.Compiler.lookupVar 
> > > (Compiler.java:6780)
>
> > > What could that exception mean? What's a starting point for debugging?
>
> > The full stack trace:
>
> >         clojure.lang.Compiler.lookupVar (Compiler.java:6780)
> >         clojure.lang.Compiler.isMacro (Compiler.java:6260)
> >         clojure.lang.Compiler.macroexpand1 (Compiler.java:6315)
> >         clojure.lang.Compiler.macroexpand (Compiler.java:6381)
> >         clojure.lang.Compiler.eval (Compiler.java:6449)
> >         clojure.lang.Compiler.eval (Compiler.java:6454)
> >         clojure.lang.Compiler.eval (Compiler.java:6431)
> >         clojure.core/eval (core.clj:2795)
> >         midje.util.report__init.load (:4)
> >         midje.util.report__init. (:-1)
> >         java.lang.Class.forName0 (Class.java:-2)
> >         java.lang.Class.forName (Class.java:247)
>
> > Line 4 of midje.util.report is unusual in several ways:  it precedes the ns 
> > call, adds a second ns call, does an eval, and uses def forms not at the 
> > top level:
>
> > (when (= (class clojure.test/report) clojure.lang.MultiFn)
> >   (eval
> >    '(do (require 'clojure.test)
> >         (ns clojure.test)
> >         (defonce old-report clojure.test/report
>
> > Not sure where the problem is yet, and I have no time to look further 
> > tonight, but perhaps this will help somebody track the root cause.
>
> At least you could simplify this and avoid using eval, by using
> clojure.core/intern directly instead of trying to get the compiler to
> believe you're in that namespace. Grabbing the source for the defonce
> macro, here's a draft of how I might rewrite this to avoid eval:
>
> (let [ns-obj (the-ns (doto 'clojure.test require))
>       the-var (intern ns-obj 'old-report)]
>   (when-not (.hasRoot the-var)
>     (intern ns-obj 'old-report clojure.test/report)))
>
> Seems to have the same effect as the defonce in some simple testing.

Of course it's silly to use intern the second time: (.setRoot the-var
clojure.test/report) would have been simpler. And of course I don't
know whether this will fix the problem, but it seems like it should at
least simplify it.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Alan Malloy
On Nov 8, 4:44 pm, Stuart Halloway  wrote:
> > This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages differ.
>
> > Consider a trivial project that `uses` midje:
>
> >    (ns midje-aot.core
> >      (:use midje.sweet))
>
> > If it's aot-compiled, everything appears to go well:
>
> >    1762 $ lein compile
> >    Copying 6 files to /Users/marick/src/midje-aot/lib
> >    Copying 1 file to /Users/marick/src/midje-aot/lib/dev
> >    Compiling midje-aot.core
> >    Compilation succeeded.
>
> > But certain of the namespaces can't be loaded:
>
> > 1766 $ lein repl
> > REPL started; server listening on localhost port 40437
> > user=> (require 'midje.semi-sweet)
> > NullPointerException   clojure.lang.Compiler.lookupVar (Compiler.java:6780)
>
> > What could that exception mean? What's a starting point for debugging?
>
> The full stack trace:
>
>         clojure.lang.Compiler.lookupVar (Compiler.java:6780)
>         clojure.lang.Compiler.isMacro (Compiler.java:6260)
>         clojure.lang.Compiler.macroexpand1 (Compiler.java:6315)
>         clojure.lang.Compiler.macroexpand (Compiler.java:6381)
>         clojure.lang.Compiler.eval (Compiler.java:6449)
>         clojure.lang.Compiler.eval (Compiler.java:6454)
>         clojure.lang.Compiler.eval (Compiler.java:6431)
>         clojure.core/eval (core.clj:2795)
>         midje.util.report__init.load (:4)
>         midje.util.report__init. (:-1)
>         java.lang.Class.forName0 (Class.java:-2)
>         java.lang.Class.forName (Class.java:247)
>
> Line 4 of midje.util.report is unusual in several ways:  it precedes the ns 
> call, adds a second ns call, does an eval, and uses def forms not at the top 
> level:
>
> (when (= (class clojure.test/report) clojure.lang.MultiFn)
>   (eval
>    '(do (require 'clojure.test)
>         (ns clojure.test)
>         (defonce old-report clojure.test/report
>
> Not sure where the problem is yet, and I have no time to look further 
> tonight, but perhaps this will help somebody track the root cause.

At least you could simplify this and avoid using eval, by using
clojure.core/intern directly instead of trying to get the compiler to
believe you're in that namespace. Grabbing the source for the defonce
macro, here's a draft of how I might rewrite this to avoid eval:

(let [ns-obj (the-ns (doto 'clojure.test require))
  the-var (intern ns-obj 'old-report)]
  (when-not (.hasRoot the-var)
(intern ns-obj 'old-report clojure.test/report)))

Seems to have the same effect as the defonce in some simple testing.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj extracurricular activities spreadsheet

2011-11-08 Thread fyuryu
Please add me to the following:

ClojureScipt
core.logic
Clojure tooling
ClojureCLR
Literate Programming
D3 and ClojureScript

Thanks,
Roland Sadowski

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: scheme to clojure translation

2011-11-08 Thread Jim Crossley
Hi

Aquahappy  writes:

[...]

> 1:  (define (compose f g) (lambda (x) (f (g x
> 2:  (define (twice f) (compose f f))
> 3:  (define fourth (twice sq))
> 4:  (fourth 3)
>
> I've gotten this far and then I get stuck when I try to do line 2 from
> the above:
>
> 1:  (defn compose [f g] #(f (g %)))

This is what I came up with. Note I also defined the sq function.

user=> (defn compose [f g] #(f (g %)))
#'user/compose
user=> (defn twice [f] (compose f f))
#'user/twice
user=> (defn sq [x] (* x x))
#'user/sq
user=> (def fourth (twice sq))
#'user/fourth
user=> (fourth 3)
81

Jim

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: scheme to clojure translation

2011-11-08 Thread Ambrose Bonnaire-Sergeant
Hi Joshua,

I've gotten this far and then I get stuck when I try to do line 2 from
> the above:
> 1:  (defn compose [f g] #(f (g %)))


Try (defn compose [f g] (fn [x] (f (g x

On Wed, Nov 9, 2011 at 9:10 AM, Aquahappy  wrote:

> Hi All,
>
> I'm working through Brian Harvey's 61a 2008 SICP lecture (http://
> www.youtube.com/watch?v=ljOrUCqsixs) and could really use a hand
> translating a couple of simple lines from scheme to clojure.
>
> Here is the code:
>
> 1:  (define (compose f g) (lambda (x) (f (g x
> 2:  (define (twice f) (compose f f))
> 3:  (define fourth (twice sq))
> 4:  (fourth 3)
>
> I've gotten this far and then I get stuck when I try to do line 2 from
> the above:
>
> 1:  (defn compose [f g] #(f (g %)))
>
> Thanks in advance for any takers,
> Joshua
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

scheme to clojure translation

2011-11-08 Thread Aquahappy
Hi All,

I'm working through Brian Harvey's 61a 2008 SICP lecture (http://
www.youtube.com/watch?v=ljOrUCqsixs) and could really use a hand
translating a couple of simple lines from scheme to clojure.

Here is the code:

1:  (define (compose f g) (lambda (x) (f (g x
2:  (define (twice f) (compose f f))
3:  (define fourth (twice sq))
4:  (fourth 3)

I've gotten this far and then I get stuck when I try to do line 2 from
the above:

1:  (defn compose [f g] #(f (g %)))

Thanks in advance for any takers,
Joshua

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj extracurricular activities spreadsheet

2011-11-08 Thread ckirkendall
Please sign me up (or give me edit access to the document) for:

ClojureScript
Clojure Tooling
The Web and Clojure

Thank you!

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Another newbie question

2011-11-08 Thread Sean Corfield
On Tue, Nov 8, 2011 at 4:09 PM, pron  wrote:
> Yes, but it lacks cross-referencing and linking from within the docstrings
> themselves (like Javadoc's @See).

You can use :see-also metadata to cause autodoc to generate
cross-references with links... I think it would be pretty easy to
extend autodoc to do more of what you're looking for (but I think it's
already closer than you might believe :)

> BTW, I'd like to say that your "Real World Clojure" series has been
> extremely helpful. Thank you for that. I wish someone would write a similar
> series about the less technological aspects. Something along the lines of
> Alex Miller's excellent post - we could use more of that!

Yup, I plan to write more in that series!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Stuart Halloway
> This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages differ.
> 
> Consider a trivial project that `uses` midje:
> 
>(ns midje-aot.core
>  (:use midje.sweet))
> 
> If it's aot-compiled, everything appears to go well:
> 
>1762 $ lein compile
>Copying 6 files to /Users/marick/src/midje-aot/lib
>Copying 1 file to /Users/marick/src/midje-aot/lib/dev
>Compiling midje-aot.core
>Compilation succeeded.
> 
> But certain of the namespaces can't be loaded:
> 
> 1766 $ lein repl
> REPL started; server listening on localhost port 40437
> user=> (require 'midje.semi-sweet)
> NullPointerException   clojure.lang.Compiler.lookupVar (Compiler.java:6780)
> 
> What could that exception mean? What's a starting point for debugging?

The full stack trace:

clojure.lang.Compiler.lookupVar (Compiler.java:6780)
clojure.lang.Compiler.isMacro (Compiler.java:6260)
clojure.lang.Compiler.macroexpand1 (Compiler.java:6315)
clojure.lang.Compiler.macroexpand (Compiler.java:6381)
clojure.lang.Compiler.eval (Compiler.java:6449)
clojure.lang.Compiler.eval (Compiler.java:6454)
clojure.lang.Compiler.eval (Compiler.java:6431)
clojure.core/eval (core.clj:2795)
midje.util.report__init.load (:4)
midje.util.report__init. (:-1)
java.lang.Class.forName0 (Class.java:-2)
java.lang.Class.forName (Class.java:247)

Line 4 of midje.util.report is unusual in several ways:  it precedes the ns 
call, adds a second ns call, does an eval, and uses def forms not at the top 
level:

(when (= (class clojure.test/report) clojure.lang.MultiFn)
  (eval
   '(do (require 'clojure.test)
(ns clojure.test)
(defonce old-report clojure.test/report

Not sure where the problem is yet, and I have no time to look further tonight, 
but perhaps this will help somebody track the root cause.

Stu

Stuart Halloway
Clojure/core
http://clojure.com

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Another newbie question

2011-11-08 Thread pron


On Tuesday, November 8, 2011 8:42:13 PM UTC+2, Sean Corfield wrote:
>
> Have you looked at autodoc? 
>

Yes, but it lacks cross-referencing and linking from within the docstrings 
themselves (like Javadoc's @See). I would like to suggest tagging in order 
to compensate for the lack of  Javadoc's "Use" page (that is possible due 
to static typing) - something that will allow grouping functions according 
to concepts and/or data structures in addition to grouping by namespace.

BTW, I'd like to say that your "Real World Clojure" series has been 
extremely helpful. Thank you for that. I wish someone would write a similar 
series about the less technological aspects. Something along the lines of 
Alex Miller's excellent 
post - 
we could use more of that!

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Brian Marick
This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages differ.

Consider a trivial project that `uses` midje:

(ns midje-aot.core
  (:use midje.sweet))

If it's aot-compiled, everything appears to go well:

1762 $ lein compile
Copying 6 files to /Users/marick/src/midje-aot/lib
Copying 1 file to /Users/marick/src/midje-aot/lib/dev
Compiling midje-aot.core
Compilation succeeded.

But certain of the namespaces can't be loaded:

1766 $ lein repl
REPL started; server listening on localhost port 40437
user=> (require 'midje.semi-sweet)
NullPointerException   clojure.lang.Compiler.lookupVar (Compiler.java:6780)

What could that exception mean? What's a starting point for debugging?

-
Brian Marick, Artisanal Labrador
Now working at http://path11.com
Contract programming in Ruby and Clojure
Occasional consulting on Agile


-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


ANN: Clojail 0.5.0

2011-11-08 Thread Anthony Grimes
In anticipation of the Conj and my talk about sandboxing + clojail there, 
I've just cut a new major release of the library. Here are some of the 
changes:


   - Code has been cleaned up significantly.
   - Old broken attempts at supporting both blacklisting and whitelisting 
   are gone, and only blacklisting is supported now. Whitelisting never worked 
   properly anyways.
   - The sandbox keeps an eye on the number of things defined in the 
   sandbox namespace, and it unmaps them if the number of them exceed a 
   certain configurable number.
   - Each sandbox has its own namespace, this way you're mostly okay if you 
   allow users to def things in your sandbox as long as each user has his own 
   sandbox.
   - clojail.jvm has been spruced up and made more usable as a library in 
   itself. It is the JVM sandboxing part of clojail is fairly standalone, 
   though clojail.core's stuff integrates it.
   - You can pass code that the sandbox will evaluate in the sandbox 
   namespace when you create it. This code will be ran outside of the actual 
   sandbox and thus can contain things that the sandbox doesn't allow. It is 
   good for preparing a sandbox namespace. You pass this code to the sandbox 
   creation functions as the keyword argument :init.
   - You can pass :refer-clojure false to prevent the sandbox from 
   referring Clojure in the sandbox namespace. It is expected that if you do 
   this, you'll refer stuff with code passed to the :init key.
   - The argument order of the sandbox function returned from calling 
   sandbox* has its argument order reversed. The code comes before the tester 
   now.
   - A number of holes have been fixed.

All of this is the result of writing a talk about the library. You'd be 
surprised how insane your library looks when you're writing a talk about it.

The new release is on clojars and we're now at v0.5.0. Clojail is also on 
Github at https://github.com/flatland/clojail

Enjoy.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: using sqlite3

2011-11-08 Thread Mark Rathwell
Haven't tested, but seems like this should get you started with korma:

lein:

[korma "0.2.1"]
[sqlitejdbc "0.5.6"]

korma [1]:

(defdb mydb {:classname "org.sqlite.JDBC"
:subprotocol "sqlite"
:subname "db/mydb.sqlite3"});; Location of the db

[1] http://sqlkorma.com/


On Tue, Nov 8, 2011 at 3:47 PM, loonster  wrote:
> After searching long and hard, there really isn't any good
> documentation for using sqlite3 with clojure 1.3.  Any help connecting
> to an existing sqlite3 db and performing selects and updates greatly
> appreciated.   Tim
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Dynamic test creation?

2011-11-08 Thread Alex Baranosky
Sounds lile you could use Midje's tabular tests.  Or if you want write a
acro to generate a tabular fact.  Tje tabular fact will give you good
reporting.
On Nov 8, 2011 1:44 PM, "AndyK"  wrote:

> I finally had a chance to try this out and it fails with
>
> error: java.lang.ClassCastException: java.lang.String cannot be cast
> to clojure.lang.IObj
> Compilation failed.
>
> When I substituted in something like this...
>
> (defn prn-form [n scenario]
>  `(prn ~(str "foo" n) (prn ~(str n " :: " scenario
>
> the file did compile.
>
> Is the fact that deftest is also a macro going to cause a problem with
> the original idea?
>
> On Nov 2, 8:36 am, Nate Young  wrote:
> > On 11/01/2011 03:05 PM, AndyK wrote:
> >
> > > How would (run-tests 'my-namespace) know to run all thosedynamic
> > > tests? I thought that it parsed the namespace for 'my-namespace when
> > > you call it. Or is it that the call to defcsvtests sets off a chain of
> > > macro resolutions before run-tests can even do its thing (so that it
> >
> > Right. Its that the macro-expansion phase actually reads from the csv
> > file in order to create a number of deftest forms, and each one then
> > gets evaluated, so after you've evaluated (defcsvtests), then
> > (run-tests) will be able to find a number of tests to run.
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question about cons function

2011-11-08 Thread Gary Trakhman
this may help: 
http://stackoverflow.com/questions/3008411/clojure-seq-cons-vs-list-conj

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

using sqlite3

2011-11-08 Thread loonster
After searching long and hard, there really isn't any good
documentation for using sqlite3 with clojure 1.3.  Any help connecting
to an existing sqlite3 db and performing selects and updates greatly
appreciated.   Tim

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: question about cons function

2011-11-08 Thread Gary Trakhman
One of the best ways to learn clojure is to take a look at the minimal and 
excellent source code: 


http://clojuredocs.org/clojure_core/clojure.core/cons
(def
 ^{:arglists '([x seq])
:doc "Returns a new seq where x is the first element and seq is
the rest."
   :added "1.0"
   :static true}

 cons (fn* ^:static cons [x seq] (. clojure.lang.RT (cons x seq


calls:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java

static public ISeq cons(Object x, Object coll){
//ISeq y = seq(coll);
if(coll == null)
return new PersistentList(x);
else if(coll instanceof ISeq)
return new Cons(x, (ISeq) coll);
else
return new Cons(x, seq(coll));
}

You can see it creates a new list.  Not sure why conceptually, but there it 
is.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: question about cons function

2011-11-08 Thread Ambrose Bonnaire-Sergeant
Hi Nicholas,

cons returns a Cons type, which is printed like a list.

Clojure> (type (cons­ 1 []))
clojure.lang.Cons

Many functions that deal with collections generally return seq's, which
also print like lists.

See: http://clojure.org/sequences

Thanks,
Ambrose

On Wed, Nov 9, 2011 at 2:21 AM, Nicolas Garcin <
nicolas.etienne.gar...@gmail.com> wrote:

> Hello,
>
> I'm a new Closure user and I'm wondering why the 'cons' function
> applied on a vector returns a list.
> Ex:
> user=> (def v1 [:one :two])
> #'user/v1
> user=> (cons :three v1)
> (:three :one :two)
> user=>
>
> Thanks for your help,
> Regards,
> Nicolas
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Solving this with logic programing

2011-11-08 Thread Ambrose Bonnaire-Sergeant
Hi Michael,

Interesting implementation, personally I'm not well versed in programming
with sets. Looks like a very nice style, will use this to check it out.

Thanks,
Ambrose

On Mon, Nov 7, 2011 at 2:26 AM, Michael Jaaka
wrote:

> Well, despite of fact that core.logic is fine tool and is worth of study,
> I have implemented own solution to my problem.
>
> Here is a full implementation: http://pastebin.com/Z5BETZd3
>
> And the idea is to index each value in record perserving the record and
> meaning of values. Then search by these values. The mini DSL contains "from
> insert select where" keywords.
>
> The resulting usage code is:
>
> (defn permission[ roles ops states ]
> (letfn [ (or-nil [ a ] (or a #{ nil })) ]
> (from :permission
> (doseq[ r (or-nil roles) o (or-nil ops) s (or-nil states) ]
> (insert { :role r :op o :state s })
>
> (permission #{:admin :operator } #{:reject :accept} #{:applied} )
> (permission #{:auditor :operator } #{:list} any )
> (permission #{:operator } #{:enter} #{:dirty} )
>
> (defn can-access[ role op state ]
> (not (empty? (from :permission
> (where { :role role :op op :state state })
>
> (defn get-operations[ role state ]
> (map :op (from :permission
> (select [ :op ]
> (where { :role role :state state })
>
> ; Some tests
>
> (get-operations  :operator :applied)
> (can-access :auditor :list :applied)
> (can-access :admin :enter :dirty)
>
>
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Including java classes using lein

2011-11-08 Thread Joost
On Nov 8, 7:33 pm, megabite  wrote:
> I'm trying to use Math/sqrt using clojure 1.3.0 and lein but for some
> reason I can't get it to work.
>
> What do I need to put in the project.clj file and what needs to go
> into the (ns ...) statement in the core.clj file in order to get this
> work? It should be fairly straightforward but there don't seem to be
> any examples of this online. The only examples use [org.clojure/
> clojure-contrib "1.2.0"] which causes Maven to dump a bunch of errors.

java.lang.Math and all standard java library classes do not need any
lein configuration to work; they're always available when you run
clojure on a standard java runtime.

in addition, all the java.lang.* classes are directly addressable
without using imports.

Here's a session using clojure 1.3 with nothing in the project.clj
dependencies except org.clojure/clojure-1.3:

user> (Math/sqrt 4)
2.0

If that doesn't work, please tell us what you're doing.

ps: clojure-contrib 1.2 is not compatible with clojure 1.3 - don't try
to mix them in your projects.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Including java classes using lein

2011-11-08 Thread Mark Rathwell
J2SE is available by default (since it is included with the JVM).  I
believe java.lang.* is accessible without importing, and anything else
needs to be imported before using, can't remember for sure though.

So, (Math/sqrt 25) should just work.


On Tue, Nov 8, 2011 at 1:33 PM, megabite  wrote:
> I'm trying to use Math/sqrt using clojure 1.3.0 and lein but for some
> reason I can't get it to work.
>
> What do I need to put in the project.clj file and what needs to go
> into the (ns ...) statement in the core.clj file in order to get this
> work? It should be fairly straightforward but there don't seem to be
> any examples of this online. The only examples use [org.clojure/
> clojure-contrib "1.2.0"] which causes Maven to dump a bunch of errors.
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


question about cons function

2011-11-08 Thread Nicolas Garcin
Hello,

I'm a new Closure user and I'm wondering why the 'cons' function
applied on a vector returns a list.
Ex:
user=> (def v1 [:one :two])
#'user/v1
user=> (cons :three v1)
(:three :one :two)
user=>

Thanks for your help,
Regards,
Nicolas

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Including java classes using lein

2011-11-08 Thread megabite
I'm trying to use Math/sqrt using clojure 1.3.0 and lein but for some
reason I can't get it to work.

What do I need to put in the project.clj file and what needs to go
into the (ns ...) statement in the core.clj file in order to get this
work? It should be fairly straightforward but there don't seem to be
any examples of this online. The only examples use [org.clojure/
clojure-contrib "1.2.0"] which causes Maven to dump a bunch of errors.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Mostly λazy, a Clojure podcast

2011-11-08 Thread Chas Emerick
FYI:

> As some of you may know already, I've started a Clojure podcast called Mostly 
> λazy.  The first episode is in the can and has been published.  There are RSS 
> feeds for your readers and podcatchers there for the taking, and I'll be 
> working on getting the feed into iTunes shortly.
> 
> The initial announcement post for Mostly λazy drew a lot of really good ideas 
> and suggestions, many of which I'll be stealing. :-D I'm really glad that a 
> lot of people find the concept of a Clojure podcast appealing; whilst I'm 
> fundamentally doing this to enjoy myself, it's nice to know that there will 
> be at least a dozen or so people listening... ;-)

Read more:

http://wp.me/p10OJi-cv

Thanks again to Sean Corfield for being such a good sport and coming on the 
inaugural episode.

Outside of special circumstances, I'll likely not post about Mostly λazy here 
again.  Go subscribe to one of its feeds or follow me @cemerick if you want to 
be notified of new episodes, news, etc.

Cheers,

- Chas


-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


SQL Korma Missing Pred

2011-11-08 Thread Dennis Crenshaw
Let me start by saying, I'm loving this SQLKorma, it feels like just the
right amount of syntax. And there's exec-raw for super fast integration
into an project with existing SQL statements.

However, while kicking the tires I ran into a weird problem, every
predicate works except <=, eg:

$=> (select table (where {:id [<= 1]}))
$=> CompilerException java.lang.RuntimeException: No such var:
korma.internal.sql/pred-<=, compiling:(NO_SOURCE_PATH:46)

Perhaps I'm missing something but all the rest of the pred-vars are there,
that specific one is missing. I wanted to ask before I bother someone with
a ticket.

Thanks,
Dennis

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Dynamic test creation?

2011-11-08 Thread AndyK
I finally had a chance to try this out and it fails with

error: java.lang.ClassCastException: java.lang.String cannot be cast
to clojure.lang.IObj
Compilation failed.

When I substituted in something like this...

(defn prn-form [n scenario]
  `(prn ~(str "foo" n) (prn ~(str n " :: " scenario

the file did compile.

Is the fact that deftest is also a macro going to cause a problem with
the original idea?

On Nov 2, 8:36 am, Nate Young  wrote:
> On 11/01/2011 03:05 PM, AndyK wrote:
>
> > How would (run-tests 'my-namespace) know to run all thosedynamic
> > tests? I thought that it parsed the namespace for 'my-namespace when
> > you call it. Or is it that the call to defcsvtests sets off a chain of
> > macro resolutions before run-tests can even do its thing (so that it
>
> Right. Its that the macro-expansion phase actually reads from the csv
> file in order to create a number of deftest forms, and each one then
> gets evaluated, so after you've evaluated (defcsvtests), then
> (run-tests) will be able to find a number of tests to run.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Another newbie question

2011-11-08 Thread Sean Corfield
On Tue, Nov 8, 2011 at 3:14 AM, pron  wrote:
> Yeah, sure, but docstrings aren't linkable. It's interesting that Java, with
> all its faults, has an incredible documentation system.

Have you looked at autodoc? It's responsible for generating stuff like this:

http://clojure.github.com/java.jdbc/

Direct links to source code, table of contents containing links to all
the functions...

> Well, that in itself is reassuring.  Can anyone share the size of the team
> involved? The duration of the project?

I'll leave that to others. World Singles has a small team. The project
is ongoing. I started working with Clojure in early 2010 and
introduced it at work probably about a year ago as an option for our
JVM-based mixed-language codebase. Our first Clojure code went to
production in June or July and we're very happy with how things are
going.

> some, like Clojure, are
> more novel (if not in their language concepts, then in their commercial
> applications).

A lot of working production software has been built with Lisps over
the years (but I understand your concerns about the "novelty" of
Clojure, in terms of age). The list of Clojure "success stories" has a
broad range of companies but I'll concede a lot of them are
startup-style organizations who are a lot less risk-averse than many
corporations:

http://dev.clojure.org/display/community/Clojure+Success+Stories
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: lein test with command-line args?

2011-11-08 Thread Phil Hagelberg
On Tue, Nov 8, 2011 at 10:16 AM, AndyK  wrote:
> Those are cool - thank you for bringing them to my attention
>
> They don't appear to address the issue of setting up environment data.
> For example, lein test :development -vs- lein test :staging where
> different configs are loaded for :development or :staging (ex:
> database, web endpoints).

OK, I see. I recommend using environment variables for that kind of
configuration.

-Phil

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: lein test with command-line args?

2011-11-08 Thread AndyK
Those are cool - thank you for bringing them to my attention

They don't appear to address the issue of setting up environment data.
For example, lein test :development -vs- lein test :staging where
different configs are loaded for :development or :staging (ex:
database, web endpoints).

On Nov 7, 5:17 pm, Phil Hagelberg  wrote:
> On Mon, Nov 7, 2011 at 2:14 PM, AndyK  wrote:
> > Is it possible to pass command-line arguments to tests using
> > leiningen? Looking for ways to control the way that tests are run
> > usingleintestby passing in switches (e.g. which environment it runs
> > against, which tests run, etc). One workaround that occurs to me is to
> > useleinrun where run calls run-tests directly, but that seems
> > hacktacular.
>
> Have you tried usingtestselectors? "leinhelp tutorial" explains how
> they work.
>
> -Phil

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure Conj extracurricular activities spreadsheet

2011-11-08 Thread Paul Mooser
Please sign me up (or give me edit access to the document and I'll add
myself) for:

core.logic / minikanren
clojure tooling
heroku drinkup
D3 and clojurescript
clojurescript
literate programming

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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Another newbie question

2011-11-08 Thread pron


On Tuesday, November 8, 2011 8:04:19 AM UTC+2, Sean Corfield wrote:
>
> docstrings?
>
Yeah, sure, but docstrings aren't linkable. It's interesting that Java, 
with all its faults, has an incredible documentation system. Scala has a 
problem in this field, too, since the complex typing and tricks and 
advanced features used to generate DSLs make Scaladocs almost useless in 
some cases. That is one of Scala's major pain points, IMO. I think Clojure 
could have a better documentation story. Maybe automatic links inside 
docstrings? Maybe tagging docstrings (and I mean tags like GMail tags. 
Something which helps you create ad-hoc groupings)?

A lot of folks here are successfully using Clojure in large, 
> complex projects 
>

Well, that in itself is reassuring.  Can anyone share the size of the team 
involved? The duration of the project? 
I realize that young languages don't yet have well-established 
industry-wide development practices (do old languages?), but some of them 
bear greater similarity to what we have been doing for years, and some, 
like Clojure, are more novel (if not in their language concepts, then in 
their commercial applications). They might hold greater promise, but are 
more scary to introduce into working teams. I think the developer 
community, at least those of us more fearful to tread into uncharted 
territory, would greatly benefit from talks/blog posts focusing on the *process 
*of developing in Clojure, thus making the territory more... charted.
 

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Stanford ai-class

2011-11-08 Thread finbeu
Hi Simon

I originally thought that I'd be trying to implement things in 
> Clojure. In hindsight, while it's been interesting to look at the 
> programming assignments, I wouldn't have had time for something in 
> that depth. Have you tried? 
>

No. But that was my initial plan as well to do it in clojure. So for the 
upcoming homeworks, I will do some in clojure if it makes sense and post 
the stuff on reddit (or maybe here) so I can get a code review.

Finn
 

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en