core-typed

kishima 2022-10-20T18:42:30.005869Z

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?

kishima 2022-10-20T18:48:03.277279Z

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

kishima 2022-10-20T18:48:05.154319Z

like

kishima 2022-10-20T18:48:27.481959Z

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

kishima 2022-10-20T18:48:44.149249Z

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

kishima 2022-10-20T18:48:51.868659Z

Without fully qualifying them

2022-10-20T18:58:34.432529Z

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]).

2022-10-20T18:59:43.611589Z

This is pretty obvious in hindsight, but worth noting 10 years ago ๐Ÿ™‚

kishima 2022-10-20T18:59:43.725139Z

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

2022-10-20T19:02:07.586279Z

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

kishima 2022-10-20T19:02:51.554319Z

Nice, thank you!

๐Ÿ‘ 1