On Jan 9, 2014, at 6:33 PM, Stuart Sierra wrote:
> I wrote clojure.walk, but I don't usually recommend it for anything but
> casual use.
>
> clojure.walk very general, so it's not going to be the most efficient
> approach. When you know more details about the data
I wrote clojure.walk, but I don't usually recommend it for anything but
casual use.
clojure.walk very general, so it's not going to be the most efficient
approach. When you know more details about the data structure you're
working with, as in this case, you can make somethi
Perhaps this is well known to others, but on the chance that maybe it isn't I
thought I'd share.
In clojure.walk both prewalk and postwalk use recursion in ways that will blow
the stack for sufficiently deep nested structures. We had been using them
happily until recently when thin
type doesn't implement the full
> IPersistentCollection contract (ie, there's no implementation of
> empty).
I'm not so sure this is the right way to look at the issue.
clojure.walk doesn't work on records, for example, also because of a
missing implementation of empty, an
Please create a JIRA ticket for adding 'empty' support to `bean`.
-S
--
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
On Tue, Dec 13, 2011 at 2:51 PM, Alan Malloy wrote:
> On Dec 13, 11:36 am, Stuart Sierra
> wrote:
>> It's not clojure.walk, it's bean:
>>
>> user=> (empty (bean "hi"))
>> AbstractMethodError
>> clojure.lang.APersistentMap.empty(
On Dec 13, 11:36 am, Stuart Sierra
wrote:
> It's not clojure.walk, it's bean:
>
> user=> (empty (bean "hi"))
> AbstractMethodError
> clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
> clojure.core.proxy$clojure.lang.APersistent
On Tue, Dec 13, 2011 at 11:38 AM, Alan Malloy wrote:
> Issue is in bean, not walk. walk calls (empty foo) on its collection,
> in order to make sure you get back a collection of the same type. bean
> maps are, I guess, some special type rather than an ordinary
> c.l.PersistentHashMap; and that typ
tract (ie, there's no implementation of
empty).
On Dec 13, 9:07 am, Jay Fields wrote:
> I think I found a bug
>
> user=> (bean "hi")
> {:empty false, :class java.lang.String, :bytes #}
> user=> (clojure.walk/stringify-keys (bean "hi"))
> AbstractMet
It's not clojure.walk, it's bean:
user=> (empty (bean "hi"))
AbstractMethodError
clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
clojure.core.proxy$clojure.lang.APersistentMap$0.empty (:-1)
The generated class doesn't implement the 'e
I think I found a bug
user=> (bean "hi")
{:empty false, :class java.lang.String, :bytes #}
user=> (clojure.walk/stringify-keys (bean "hi"))
AbstractMethodError
clojure.lang.APersistentMap.empty()Lclojure/lang/IPersistentCollection;
clojure.core.proxy$clojure.lang.A
On Jul 21, 9:59 pm, Pedro Teixeira wrote:
> On Jun 22, 6:23 pm, Krešimir Šojat wrote:
>
> > While traversing the data structure both prewalk and postwalk remove
> > all the metadata:
>
> > user=> (require '[clojure.walk :as w])
> > nil
> &g
On Jun 22, 6:23 pm, Krešimir Šojat wrote:
> While traversing the data structure both prewalk and postwalk remove
> all the metadata:
>
> user=> (require '[clojure.walk :as w])
> nil
> user=> (def data {:a ^{:a :this-is-a} [1 2 3]})
> #'user/data
> user=>
While traversing the data structure both prewalk and postwalk remove
all the metadata:
user=> (require '[clojure.walk :as w])
nil
user=> (def data {:a ^{:a :this-is-a} [1 2 3]})
#'user/data
user=> (meta (:a data))
{:a :this-is-a}
user=> (meta (:a (w/postwalk identity data))
clojure.walk is a terrible hack that I wrote and abandoned 2 years
ago. It never should have made it into the Clojure distribution, for
which I apologize. I will campaign for its deletion just as soon as I
find a suitable replacement.
-SS
--
You received this message because you are
I discussed prewalk and postwalk with a another Clojure user that I am
friends with. He sent me the following, via email, this morning:
I have a workaround/solution for you.I still don't know exactly
why, but the :else clause in walk calls outer on form. This will give
you all sorts of class
Kevin, thank you for your example.
Ok here is what I get:
(prewalk #(doto % prn) [[3 [3]] [3 3]])
[[3 [3]] [3 3]]
[3 [3]]
3
[3]
3
[3 3]
3
3
[[3 [3]] [3 3]]
Thus, it appears that an "element" of my nested vectors isn't just the
values within the vectors, but also stands for the inner vectors as
we
I'm not overly familiar with clojure.walk, but I think you'll find the
output of (prewalk #(doto % prn) [[3 [3]] [3 3]]) very illuminating.
On Fri, Mar 19, 2010 at 2:13 PM, cej38 wrote:
> This post has two parts.
>
> Part 1.
>
> I know that the API is trying to hit the
This post has two parts.
Part 1.
I know that the API is trying to hit the sweet spot on the brevity vs.
information curve, but there are several areas where more information
is needed; one of these is clojure.walk.
Let's say that I have some nested set of vectors:
(def nestV [ [0 [0] ]
Hello everyone,
Recently the following lib were promoted from contrib to the standard
library:
* clojure.contrib.test-is becomes clojure.test
* clojure.contrib.stacktrace becomes clojure.stacktrace
* clojure.contrib.template becomes clojure.template
* clojure.contrib.walk becomes clojure.walk
20 matches
Mail list logo