ClojureScript

Extend ns form to support :rename option

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 1.7.145
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

Support a :rename option to :require. Following :rename should be a map of symbol to symbol. Refer to clojure.core/refer for semantics with respect to this allowing avoidance of clashes.

An REPL example:

(require '[fipp.edn :refer (pprint) :rename {pprint fipp}])
  1. CLJS-1508.patch
    01/Aug/16 7:24 AM
    16 kB
    António Nuno Monteiro
  2. CLJS-1508-1.patch
    09/Aug/16 1:18 PM
    27 kB
    António Nuno Monteiro

Activity

Hide
António Nuno Monteiro added a comment -

Added patch with fix and tests.

I'd appreciate some initial feedback on this one.

Show
António Nuno Monteiro added a comment - Added patch with fix and tests. I'd appreciate some initial feedback on this one.
Hide
David Nolen added a comment -

Flowing a new kind of value (maps) through this code seems like a big complication in an area where the code is already not particularly straightforward. I would also be a little concerned about downstream complexity (other people also have to make this check if using the analyzer for some reason).

Show
David Nolen added a comment - Flowing a new kind of value (maps) through this code seems like a big complication in an area where the code is already not particularly straightforward. I would also be a little concerned about downstream complexity (other people also have to make this check if using the analyzer for some reason).
Hide
António Nuno Monteiro added a comment -

Attached CLJS-1508-1.patch which takes feedback into account

Show
António Nuno Monteiro added a comment - Attached CLJS-1508-1.patch which takes feedback into account

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: