spyscope icon indicating copy to clipboard operation
spyscope copied to clipboard

Unsupported binding form

Open neapel opened this issue 10 years ago • 1 comments

(let [ variable #spy/d (complex expression) ] ...

prints (complex expression) => ... which can become quite unreadable, alternatively one would have to use #spy/p or set a name manually.

It would be great if the straightforward expression

(let [ #spy/d variable (complex expression) ] ...

Would print variable => ... instead of causing a load failure.

I'm not sure if this is possible using data readers — the #spy/d would have to recognize it is used on the left side of a bind expression, move to the right side and use the variable as its :form argument?

neapel avatar Jul 28 '14 18:07 neapel

That would be really awesome, and it's exactly possible, but I have some ideas for how to make it work. Here's some things we'd need to work out before implementing: how does this interact with destructuring? Does it only work on the top level binding, or does it work for inner destructuring forms?

dgrnbrg avatar Aug 02 '14 19:08 dgrnbrg