quil-lang / qvm

The high-performance and featureful Quil simulator.
Other
411 stars 57 forks source link

[#227] fix redefine warning for compile-instruction generic #274

Closed ghost closed 3 years ago

ghost commented 3 years ago

Here are two of the modules as they were ordered in qvm's asd file:

Mixed-state-qvm has a defmethod on compile-instruction. Compile-gate has the defgeneric as well as several more defmethods. The Lisp system was creating a standin defgeneric for mixed-state-qvm when it was loaded first, and so then when it loaded the explicit defgeneric in compile-gate, it issued the warning

WARNING: redefining QVM::COMPILE-INSTRUCTION in DEFGENERIC

Solution: just switch the order, placing mixed-state-qvm after compile-gate.