emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
644 stars 27 forks source link

Make an accessor for type (elsa-type) usable in `setf` #99

Closed Fuco1 closed 5 years ago

Fuco1 commented 6 years ago

The type argument should automatically be wrapped in elsa-get-type so we can pass in whatever that is type-able.

Maybe replace elsa-get-type with this function alltogether.

Fuco1 commented 6 years ago

Right now elsa-variable and elsa-form both have a type property which we update using (oset var type X) or (oset form type Y). I'm not sure which API would be best:

So far I have problem with oset/oref in that the error messages there are awful ("expected obj, obj")

@alphapapa you've mentioned setf before and also in orgba, do you have a lot of experience with it? Is it usabe with respec to debugging? I'm not too big on it in my existing code yet.

Fuco1 commented 5 years ago

We're using a generic elsa-set-type and elsa-get-type. The code is not migrated everywhere but there's an elsa check to remind us of this style change.