lilactown / helix

A simple, easy to use library for React development in ClojureScript.
Eclipse Public License 2.0
631 stars 52 forks source link

Consider keyword version of the spread operator #19

Closed darwin closed 4 years ago

darwin commented 4 years ago

& is a special symbol acting as a spread operator in $ macro expansion.

($ :div {:prop "val" & rest-props} ...)

This causes minor issue in Cursive which sees a normal map and complains about unresolved symbol &. I think adding support for :& to be optionally used in place of & should not hurt anynone.

($ :div {:prop "val" :& rest-props} ...)

See https://github.com/darwin/helix/commit/be5c3dc00790f60de5e22bdbc1ea9250b8b1981b

lilactown commented 4 years ago

I'd like to have it one or another, rather than have people open up a codebase and figure out if they should use & or :& or be inconsistent (probably based on what editor the author uses).

darwin commented 4 years ago

Ok, don't worry. You may close this. I will probably keep a fork of helix with some custom patches on top, so it is not a big issue for me atm.

lilactown commented 4 years ago

I'll keep this open as I think I want to move to a keyword version to not mess with Cursive users.

khmelevskii commented 4 years ago

Yes, it would be great to use :& instead of & because currently I have joker warning for this symbol