jaunt-lang / jaunt

[ABANDONED] A jaunt away from Clojure
https://github.com/jaunt-lang/jaunt/issues/157
134 stars 6 forks source link

Deprecate clojure.core/use #112

Closed arrdem closed 8 years ago

arrdem commented 8 years ago

This patch deprecates use, doing a bunch of legwork to provide automatic refactor suggestions for replacing use with require and refer.

arrdem commented 8 years ago

Quick demo:

2016-03-24-233013_548x154_scrot

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.

arrdem commented 8 years ago

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.

arrdem commented 8 years ago

Bug fixed. :refer forms are now legal.

2016-03-25-020436_964x283_scrot

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.

arrdem commented 8 years ago

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.

2016-03-25-183700_631x344_scrot