Fork me on GitHub
#biff
<
2023-04-02
>
Epidiah Ravachol00:04:11

I may have encountered some unexpected behavior in biff/select-ns-as. I discovered that if the ns-from argument to select-ns-as has a . in it, like foo.bar below, the map it returns will exclude all the keys that don't have the ns-form namespace. For example:

(select-ns-as {:foo/a 1, :foo.bar/b 2, :baz/c 3, :buzz.aldrin/d 11} 'foo.bar 'q-bert)
  ;; => #:q-bert{:b 2}
Which I don't think is what it's meant to do. It is, however, fortunate that it did this, because it helped me to realize I was leaning a bit heavily on rather.long.namespaces/ that really didn't need to be all that elaborate.

Jacob O'Bryant00:04:20

it is supposed to do that :)

😲 2
Jacob O'Bryant00:04:39

a bit like select-keys

Jacob O'Bryant00:04:19

(does it not do that if ns-from only has a single segment?)

Epidiah Ravachol00:04:47

Oh, ha! I've been using it wrong all along. Or rather, until now I was using it with the wrong assumptions in places where my wrong assumptions didn't matter.

Epidiah Ravachol00:04:28

Looks like I'm the April Fool, today. But in better news, I think this means I have other, more critical uses for it.

🎅 2