A question about defalias (using Typed Clojure 1.0.32). Is there a way to make a defalias using the symbolic name of a record (`ann-record`) from another namespace? It accepts the the JVM classname of the record, e.g. (t/defalias Foo that.other.namespace.full_name.Foo) as an alias for something in ns that.other.namespace.full-namewith a (t/ann-record Foo ....) for a (defrecord Foo ...) . Is there way to write (t/defalias F fnalias/Foo) or is this just for non-record types?
Hi @martin303 have you tried importing the record into your namespace? Classes should resolve using the same rules as normal.
@ambrosebs Thanks for the tip. Importing the type Foo does makes the type to be available to the type checker, so I don't have to defaliasit in the local namespace.
(similar to the fully qualified name Java class name that I used)
Now, if I understand correctly: I can reference ann type annotations using the normally using their Clojure names with the require syntax and aliases. However, ann-record type annotations must be reference using the corresponding Java class name of the record itself (e.g. underscores instead of hyphens in namespaces) and cannot reference the symbolic (Clojure) name given to ann-record
exactly. The intention was that you'd refer to the symbols "normally" in both cases, since defalias's used to intern vars.