On Jul 10, 4:52 pm, Wilfred wrote:
> I'm at a bit of a loss. "UPDATE comments SET approved='1' WHERE id =
> '1'" works fine in psql. approved is a boolean field, so is this an
> issue with the SQL library producing incorrect SQL?
I think this is an oddity with the JDBC driver for PostgreSQL. The
So the Interface specification has to be available when the record is
defined... that makes sense. Thanks Jonathan.
On 10 July 2011 14:28, Jonathan Fischer Friberg wrote:
> I think the reason is that an interface means that the function must be
> 'inside' the class.
> I.e you can call (.method ob
I don't (yet) have a PostgreSQL environment to test java.jdbc on but
I'm planning to do that soon. I've also talked to Aaron about how we
can set up DBs for automated testing on build.clojure.org so java.jdbc
can have "real" tests that I can run locally and which will also still
run on the build sy
On Sun, Jul 10, 2011 at 5:42 PM, octopusgrabbus
wrote:
> From Clojure api for max
>
> (defn max
> "Returns the greatest of the nums."
> {:added "1.0"}
> ([x] x)
> ([x y] (if (> x y) x y))
> ([x y & more]
> (reduce max (max x y) more)))
>
> Question 1: Why can y be introduced as a local bind
On Jul 9, 8:58 am, Christian Marks <9fv...@gmail.com> wrote:
> The clojure code below applies the constant space algorithm ... of C. J. Gower
... to the computation of the order of a permutation [Knuth, D. E.,
“Selected Papers on Analysis of
> Algorithms,” CSLI Lecture Notes Number 102, CSLI Pub
http://www.linuxjournal.com/article/10708 and
http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure
in combination with http://lambda-the-ultimate.org/node/3630
I'm not entirely clear on all of wikipedia's notability guidelines but these
reviews
Lets try to clear the confusion a bit here:
(def max1 [x] x)
(def max2 [x y] (if (> x y) x y))
(def max3 ([x y & more] (reduce max (max x y) more)))
The above a three different fns.
max1 has only the arg x.
max2 has only x and y
and max3 has x and y and maybe other arguments to select the maximu
On Sun, Jul 10, 2011 at 4:51 PM, octopusgrabbus
wrote:
> If the function is called with one argument, what Clojure language
> rule allows x to appear outside the vector brackets?
([x] x)
The x outside of the vector brackets is the value being returned.
So if max is called with only a single arg
Hi all
I've started a very simple compojure project to wet my feet with
Clojure. I've written a simple model changing function:
(defn approve! [id]
(sql/with-connection db
(sql/transaction
(sql/update-values :comments
["id = ?" id]
{:appr
The JVM does compile to native code once it is executed a specific number of
times. That's what the JIT compiler does. You can control how many times a
piece of code executes before it gets compiled by changing this JVM
option -XX:CompileThreshold=.
If you want to look at other JVM options yo
http://www.codequarterly.com/2011/rich-hickey/ ?
On Jul 10, 6:26 pm, Michal B wrote:
> Rich Hickey's article in Wikipedia is up for deletion again. Does anyone
> have links to solid articles about Hickey?
--
You received this message because you are subscribed to the Google
Groups "Clojure" gro
Rich Hickey's article in Wikipedia is up for deletion again. Does anyone
have links to solid articles about Hickey?
--
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
I have another question about max. Is there an advantage if this were
re-written with repl?
On Jul 10, 7:18 pm, Jonathan Fischer Friberg
wrote:
> There's no interfaces, that's the function definition.
>
> define function max
> (defn max
>
> attach docstring
> "Returns the greatest of the nums."
>
If the function is called with one argument, what Clojure language
rule allows x to appear outside the vector brackets?
On Jul 10, 7:18 pm, Jonathan Fischer Friberg
wrote:
> There's no interfaces, that's the function definition.
>
> define function max
> (defn max
>
> attach docstring
> "Returns
There's no interfaces, that's the function definition.
define function max
(defn max
attach docstring
"Returns the greatest of the nums."
attach metadata
{:added "1.0"}
if max is called with one argument, use this function definition
([x] x)
if max is called with two arguments, use this functi
Did anyone started creating native compiler for Clojure language ?
--
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 y
2) Meta data, max was introduced in V1.0
On Sun, 10 Jul 2011 14:44:16 -0700 (PDT)
octopusgrabbus wrote:
> For Question 1 this is an example of multiple interfaces. Got it.
>
> On Jul 10, 5:42 pm, octopusgrabbus wrote:
> > From Clojure api for max
> >
> > (defn max
> > "Returns the greatest o
For Question 1 this is an example of multiple interfaces. Got it.
On Jul 10, 5:42 pm, octopusgrabbus wrote:
> From Clojure api for max
>
> (defn max
> "Returns the greatest of the nums."
> {:added "1.0"}
> ([x] x)
> ([x y] (if (> x y) x y))
> ([x y & more]
> (reduce max (max x y) mor
>From Clojure api for max
(defn max
"Returns the greatest of the nums."
{:added "1.0"}
([x] x)
([x y] (if (> x y) x y))
([x y & more]
(reduce max (max x y) more)))
Question 1: Why can y be introduced as a local binding without a let?
Question 2: What is the map {:added "1.0"} doin
Whoops, I thought I was asking on the dev list, but autocompletion
sent it to the regular clojure list. Sorry about that. I'm resending
to the dev list.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@goo
Hi Mark,
Please see to http://dev.clojure.org/display/design/Clojure+Contrib
To migrate an old clojure-contrib namespace, just ask on the clojure-dev
list.
-S
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo
I think the reason is that an interface means that the function must be
'inside' the class.
I.e you can call (.method object). Since it isn't possible to extend a java
class in that way, it isn't possible to use extend. In a defrecord body
however, a new class is defined, which means that it's poss
On Jul 10, 7:15 am, Michael Gardner wrote:
>
> I think Christian wanted to know *why* one "should" eliminate recur. I can't
> think of a reason to avoid it myself, though I also don't recall hearing any
> recommendations against using recur.
Just my two cents, but the main reason to consider ma
Thanks for your response Devin.
I guess I had come to the same conclusion by the end of my email. But
I wonder if there is a more direct way of achieving the same thing
without using a macro that spits out a defrecord with in-line method
declarations? I had a quick look at the defrecord code and d
Hm, google groups did not show my first reply to myself for a while,
and I thought it had gotten lost in the way, so I sent another post,
which can be safely ignored, in case anyone wonders what the
difference between the first and the second reply is - there is none,
fundamentally.
On Jul 10, 7:5
Well, turns out string-like-coll-comparator has a bug:
x=> (subseq (sorted-map-by string-like-coll-comparator (vec "ab") 1
(vec "n") 2) > (vec "a"))
NullPointerException clojure.lang.AFunction.compare (AFunction.java:
59)
It can be fixed though:
(defn string-like-coll-comparator
[coll1 coll2
I see
Guess I'm a bit too much used to programming javascript where a
function always carries its source around with it - a very very
convenient tool in very functional languages where functions are
passed along so often
anyway, gr8 thanks!
Oded
On Jul 7, 12:11 pm, Sunil S Nandihalli
wro
Well, it can't be the best, because it has a bug. Calling it with "a"
instead of "aa" gives me a NPE:
x=> (subseq (sorted-map-by string-like-coll-comparator (vec "ab") 1
(vec "n") 2) > (vec "a"))
NullPointerException clojure.lang.AFunction.compare (AFunction.java:
59)
The following comparator s
No, use it any time you need an arbitrary symbol.
On Sun, 10 Jul 2011 10:41:56 +0200
Kazimir Majorinc wrote:
> Is gensym used for anything in Clojure except for alpha-conversion in
> macros?
>
--
Luc P.
The rabid Muppet
--
You received this message because you are subsc
But then how would all the consultants make their money? ;)
Sent from my iPad
On 10 Jul 2011, at 04:56, Luc Prefontaine wrote:
> Hey, if it does not take a year and an army of nuclear scientists to
> implement, it would already
> be better :
>
> On Sun, 10 Jul 2011 09:22:18 +0530
> Vivek K
Say I have this sorted map, using strings as keys:
x=> (sorted-map "ab" 1 "n" 2)
{"ab" 1, "n" 2}
When I do a subseq
x=> (subseq (sorted-map "ab" 1 "n" 2) > "aa")
(["ab" 1] ["n" 2])
I get back both entries.
Now if I do the same subseq on the same map, except that I turn all
strings into charact
Is gensym used for anything in Clojure except for alpha-conversion in
macros?
--
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 pati
32 matches
Mail list logo