Closed arrdem closed 8 years ago
Quick demo:
Note that my demo is actually broken because :refer
isn't a supported use
parameter. That should be :only
. No warning for this is provided yet.
Bug: refer
does not actually support multiple body forms in the style of use
or require
. Consequently the generated :refer
forms aren't actually correct.
Bug fixed. :refer
forms are now legal.
I still kinda object to this patch on the grounds that it's trying to do some amount code formatting in core, which really should either be whole-hog baked in (pls no) or avoided. The argument for doing so is primarily user convenience, as this changeset does attempt to enforce a somewhat significant and loudly complained of style change and whatever help can be provided to the user will mitigate this inconvenience.
A related concern is refer
. It's pretty clearly an implementation detail, and really only needed for unrestricted referrals (which are a bad idea and the reason for this change) and rename (which is also arguably a bad idea since it makes it more difficult to understand code if the names are locally rebound). Rewriting use to require
and refer
is correct, but if we want refer
to go away (which we may well) doing so is kinda silly.
Updated demo. (:refer)
forms never need to be emitted both the original and emitted form are now formatted nicely, and a warning is emitted if the rewritten form makes use of :rename
that it may be deprecated.
This patch deprecates use, doing a bunch of legwork to provide automatic refactor suggestions for replacing use with require and refer.