you wrap a call to Thread/sleep in parens, in clojure this means you want
to call it, Thread/sleep returns nil and calling nil gives a
NullpointerException
Parens are not for grouping or sequencing things in clojure, and you don't
need them here - fn has an implicit do block already, in other cont
Hi, all
I want to do sth. like query until timeout. So I write a function below.
(defn wait-ls-ready
[]
(let [pair-fn (fn [] (
(Thread/sleep 1000)
(let [ret (try
(c/exec :ls)
clojure.core/seq?
([x])
Return true if x implements ISeq
(seq? []) => false
because...
(instance? clojure.lang.ISeq []) => false
Vectors do not implement ISeq. That's all the seq? predicate cares about.
But vectors are `seqable?`:
clojure.core/seqable?
([x])
Return true if the seq functio
lacinia-pedestal provides the Pedestal support to expose web endpoints
backed by Lacinia's GraphQL.
The GitHub repository is https://github.com/walmartlabs/lacinia-pedestal
Documentation: http://lacinia-pedestal.readthedocs.io/en/latest/
Featured changes in 0.4.0:
- The compiled schema may, ins
Hi,
the documentation for clojure.zip/path states that it *"Returns a seq of
nodes leading to this loc". *But the following test will fail (seq? returns
false):
(require '[clojure.zip :as z])
(def v [[1]])
(def vz (z/vector-zip v))
(seq? (z/path (z/down (z/down vz
The path actually retur
Lacinia is an open-source implementation of Facebook's GraphQL
specification, in Clojure.
GraphQL is an outstanding approach to getting diverse clients and servers
exchanging data cleanly and efficiently.
The GitHub repository is https://github.com/walmartlabs/lacinia
Documentation: http://lacin
Yes, you would need to actually create a spec implementation to improve the
error message in this case.
We haven't ever talked about spec'ing meta. In one sense I'd say the
general philosophy in Clojure is that meta is *not* part of the data (as in
how equality ignores meta), and thus it's not the
Thanks Alex. But then
(s/assert ::o {})
gives
failed: (valid? ::meta-spec (meta %))
which is not quite satisfactory.
Is my understanding correct that for a more integrated approach one would need a
custom Spec implementation? And if so, shouldn't it be part of the core then?
>> On Tue
(s/def ::o #(s/valid? ::meta-spec (meta %)))
should work.
On Saturday, October 21, 2017 at 3:57:20 PM UTC-5, Vitalie Spinu wrote:
>
>
> Hi,
>
> If my meta spec looks like
>
> (s/def ::meta-spec (s/keys :req [::xyz]))
>
>
> how do I define a spec for objects whose meta conforms to `::meta-spec
Just to chime in and second what others have said, functions do not encode
their name in an accessible way. The best option right now is to use
clojure.repl/demunge on the class name.
This is a best-effort function as the transformation from Clojure function
name to Java class class name is no
No need to import the compiler. Use clojure.repl/demunge
Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
_
From: Ravindra Jaju mailto:ravindra.j.
It's a good start.
You could next import clojure.lang.Compiler and call the static method
demunge like so on the output "cool_func_BANG_"
(Compiler/demunge "cool_func_BANG_") ; => "cool-func!"
On Tue, Oct 24, 2017 at 11:27 AM, Shantanu Kumar
wrote:
> Not sure whether you can deterministically r
If I had to guess I'd say the name of the function isn't stored with it
nil
boot.user=> (clojure.reflect/reflect (fn foo [] nil))
{:bases #{clojure.lang.AFunction}, :flags #{:public :final}, :members
#{#clojure.reflect.Constructor{:name boot.user$eval1530$foo__1531,
:declaring-class boot.user$ev
13 matches
Mail list logo