quil-lang/magicl

Recompiling define-extensible-function form doesn't define the backend function

Yehouda opened this issue · 1 comments

,@(unless (magicl.backends:backend-function-p fun-name)

With the code as it is, compiling and loading a file with a define-extensible-function works first time, but if you compile again after loading it does not define the backend function, and you have a "broken" (missing the backend function) file. Loading this file in a fresh process will miss the backend implementation.

I don't see a reason why it needs to check at all, rather than do the define-backend-function form uncodnitionally. Inside define-backend-function, initialize-function-for-implementations checks again anyway, and the rest is just a defun.

I agree with you, this is the correct way to do it. Thanks!