(ns free.matrix-arithmetic
(:require [clojure.core.matrix :as mx :exclude [e*]]))
The error in Clojurescript is:
clojure.lang.ExceptionInfo: Only :as, :refer and :rename options supported in :require / :require-macros; offending spec: [clojure.core.matrix :as mx :exclude [e*]] ...
The code compiels in Clojurescript if I remove ":exclude [e*]".
Is :exclude going away as an option to require and :require, and Clojurescript is ahead of Clojure? Is this a bug?
:exclude is not a valid option here (it's not having any effect). (doc require) mentions only :as and :refer as valid options in the libspec. :exclude is an option for :refer and :refer-clojure, not for :require.
It's maybe interesting that the spec for ns does not report this problem here in :clojure.core.specs/prefix-list because of the use of keys*, which takes an open map view of options. I'll have to check with Rich if this is something we want to lock down more.
I see. Thanks. If I wanted to pull in everything but e*, for example, I could use :exclude, but there's no reason to exclude anything if I'm only using specific, namespace-qualified functions from clojure.core.matrix.
I had noticed that the docstring for require didn't mention exclude, but with some of the more complex macros and functions like require, there are sometimes minor points missing from docstrings. (That's not a complaint.)
I don't need :exclude at present, but I still can't figure out how I could pull in all functions but one from a namespace. For example, the Clojurescript compiler doesn't like this:
(ns free.matrix-arithmetic
(:require [clojure.core.matrix :as mx :refer :all :exclude [e*]]))
The spec failure report:
clojure.lang.ExceptionInfo: Only :as, :refer and :rename options supported in :require / :require-macros; offending spec: [clojure.core.matrix :refer :all :exclude [e*]] ...
Similarly, this
(ns free.matrix-arithmetic
(:use [clojure.core.matrix :exclude [e*]]))
results in this
clojure.lang.ExceptionInfo: Only [lib.ns :only (names)] and optionally `:rename {from to}` specs supported in :use / :use-macros; offending spec: [clojure.core.matrix :exclude [e*]] ...
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/y1vVdKp5EYw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescript+unsubscribe@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.
FWIW, beware that locking this down further would have to account for ClojureScript's `:refer-macros` and `:include-macros`, etc.
FWIW, beware that locking this down further would have to account for ClojureScript's `:refer-macros` and `:include-macros`, etc.