atlas-engineer / nclasses

A `define-class` macro for less boilerplate
Other
7 stars 2 forks source link

Don't infer `:unbound` slot initform to be `:type keyword`. #7

Closed aartaka closed 1 year ago

aartaka commented 1 year ago

We seem to use :unbound as the marker of the slot with unbound initform. But, it seems, our type inference thinks that this is an initform by itself and infers its type as keyword. Which is wrong.

So I guess we need to treat :unbound as a special case in type inference.


But why do we actually have :unbound, if we can omit the initform altogether? Is it because of the (removed) initform inference? If initform inference is away, then maybe we should simply remove :unbound as a special case and be happy with it?

Ambrevar commented 1 year ago

:unbound has always been there, as part of hu.dwim.defclass-star. It's so that one can write:

(defclass foo ()
  ((name :unbound :type string)))

I suppose the intention of the author was to have an explicit marker for unbound slots.

I'd rather not remove it to ease the transition from defclass-star to nclasses.

aartaka commented 1 year ago

Okay, so what's left is fixing the type inference (★^O^★)