Fork me on GitHub
#core-typed
<
2022-10-20
>
kishima18:10:30

Hello! https://github.com/clojure/core.typed/wiki/Quick-Guide#types-use-the-current-global-scope-of-the-namespace What does this mean? I have to :import the namespace where I made the defaliases with all my types? How can I do that?

kishima18:10:03

nevermind, made it work. But I actually just did a require

kishima18:10:27

(ns my.namespace
 (:require [my.types]))

kishima18:10:44

This way, I managed to access the types defined via defalias

kishima18:10:51

Without fully qualifying them

ambrosebs18:10:34

It just means that if you want to write the abbreviated version of a class in a type like File , just use import: (:import [ File]).

ambrosebs18:10:43

This is pretty obvious in hindsight, but worth noting 10 years ago 🙂

kishima18:10:43

What if it is a typed that I defined in other namespace? The way I did is the correct form? I mean, it works but maybe there’s something better

ambrosebs19:10:07

yes, a defalias is similar to a var reference without actually interning a var.

kishima19:10:51

Nice, thank you!

👍 1