Share your thoughts in the 2021 Clojure Community Survey!

Welcome! Please see the About page for a little more info on how this works.

0 votes
in Metadata by
edited by

Before evaluating its namespace metadata, I wish ns macro would:

  1. Have *ns* be bound already.
  2. :require, to be able to use :as namespace names in metadata expression.
    Example:

Current (uses fully qualified names):

    (ns my.app.foo.controller
      {:tape.mvc/interceptors [(re-frame.core/path
                                [:my.app.foo.controller/controller])]}
      (:require [re-frame.core :as rf]
                [tape.mvc :as mvc]))

After change (uses "shortcut" names):

    (ns my.app.foo.controller
      {::mvc/interceptors [(rf/path [::controller])]}
      (:require [re-frame.core :as rf]
                [tape.mvc :as mvc]))

Would this change be worthwile/acceptable/feasible?

1 Answer

0 votes
by

You’re asking for a solution here but I don’t understand the problem. Can you back up to that?

What is line 2 supposed to be doing here? What is the before version of this code?

by
I guess line 2 is metadata and you’re just wanting it to be more concise?
by
edited by
Yes (updated the example with before and after), line 2 is the namespace metadata and I want to use shortcuts instead fully qualified names, namely: `{::mvc/interceptors [(rf/path [::controller])]}` instead `{:tape.mvc/interceptors [(re-frame.core/path [:my.app.foo.controller/controller])]}`.
...