Like the doc says, `with-query-results` takes additional options
before the query string.
In your case, it should be something like this:
(sql/with-query-results recs
`[{:fetch-size 1000} ~query-str ~@bvs]
(doall recs))
--
You received this message because you are subscribed to the Google
Gr
Oh, thanks for the explanation.
I looked at the twitterbuzz code before replying, saw the function
calls with arguments written the usual way, and (erroneously) decided
it would be the same for the zero-arity calls. But it's there in the
wiki.
On Aug 1, 5:17 pm, Chouser wrote:
> In Clojure you a
When I do that, the REPL starts printing the sequence, filling screens
after screens with numbers.
By doing that, it realizes the printed part of the sequence, which
will eventually lead to an OOM error, since it probably holds on to
the reference to the start of the sequence.
Doing (set! clojure.
On Aug 1, 1:32 pm, Brian McKenna wrote:
> For anyone else with the same problem, I just found the nice way to do it:
>
> (def iframe (. field (getEditableIframe)))
This should be equivalent to (def iframe (.getEditableIframe field))
which is the usual way to do method calls on the host langua
> First: Why doesn't macroexpand expand the inner when-lets?
It's not supposed to, see the doc. To do full expansion, you can use
`clojure.walk/macroexpand-all`.
> Is the gensym in the two expands the same thing, or do "they" get the
> same name? That was surprising to me. I can't think of any re
This would be a straightforward solution:
(defmacro when-lets [bindings & body]
`(let ~bindings
(when (and ~@(map first (partition 2 2 bindings)))
~@body)))
It works well in simple cases, but breaks e.g. in case of parameter
destructuring.
If you read `(source when-let)`, you'll see
Type annotations are used at compile time to generate direct method
calls (as opposed to using reflection).
`cast` is a function, so it doesn't do anything until runtime, and it
just delegates to Class#cast.
I don't think it is used much. In the core, it's only called in single-
arity cases for *
On Jul 25, 10:54 am, Oskar wrote:
> On Jul 23, 4:06 pm, Dmitry Gutov wrote:
>
> > Ahem.
>
> > Here is a more idiomatic version that runs under half a second, no
> > annotations required.
>
> I did that from the beginning, but as I really needed 4e6 and not 1e5
Ahem.
Here is a more idiomatic version that runs under half a second, no
annotations required.
(def vs (atom {}))
(defn sk [k]
(if (@vs k)
(@vs k)
(let [ans (if (< k 56)
(- (mod (+ 13 (- (* k 23)) (* 37 k k k))
100) 50
hould be much faster than the
> previous one even with recursion, right?
>
> On Jul 22, 10:51 pm, Dmitry Gutov wrote:
>
>
>
>
>
>
>
> > In case the two replies above didn't drive the point home, the Python
> > version is not recursive (it uses results
In case the two replies above didn't drive the point home, the Python
version is not recursive (it uses results memoized in the data array).
So, not the same thing.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to c
The first version stops as soon it encounters the first item in the
collection that's too big.
The second version filters the whole collection, which may lead to a
major slowdown, depending on coll's relative size. It will also hang
if coll is infinite.
This should be better: (take-while #(<= % lim
> Is there any hope of getting rid of the servlet altogether, and
> somehow get a Ring handler to perform whatever Vaadin stuff that needs
> to be done on the server?
Well, you could rewrite the servlet in Clojure... right?
Aside from that, I don't think so. Ring works on a much lower level of
abs
You can use 'reduce':
(reduce nth m [2 2 1])
;; or, for the general case
(reduce #(%1 %2) m [2 2 1])
On Jun 30, 3:20 am, Antonio Recio wrote:
> (get-in m [2 2 1]) is great! Which are the others ones? Is there something
> like (-> m [2 2 1])?
--
You received this message because you are subscri
That's leiningen bug 62:
http://github.com/technomancy/leiningen/issues/closed/#issue/62
It should be fixed in trunk.
On Jul 31, 2:33 am, Bootvis wrote:
> There seems to be a problem with the RC on Windows. I was
> followinghttp://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applica..
15 matches
Mail list logo