dash.el
dash.el copied to clipboard
Support for vectors?
Hello,
(--each [1 2 3] (message "%s" it it))
Does not work. Is that intentional? Any plans on supporting it? For example, --map
works.
There's a task opened for that already somewhere. We wanted to do this but haven't found a good way to do it.
Can't you simply use --map
for the implementation? No because performance issues?
--map
works because it uses mapcar
. Some functions in dash which just do indirection for the sake of API will work, but most will not. You should rather not rely on that behaviour as we might change something wrt vectors and break your code.
There are options like generics to implement this but so far we haven't found it very convincing.
Alright... should I close this?
Hm, the duplicate #43 is already closed. Maybe you could use seq
too for when you need vectors.
I don't mind having this opened but we will probably not act upon this any time soon.
Alright, for the record, I'm currently working around this by passing the vector in dash as (-map 'identity myvector)
and outputing it as (apply 'vector LIST)
.