quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
448 stars 73 forks source link

Add quilc_last_error function #894

Closed notmgsk closed 11 months ago

notmgsk commented 11 months ago

Modelled after e.g. dlerror, the most recent error raised by quilc is captured in *quilc-last-error*. Calling quilc-last-error (or quilc_last_error depending on language) will

  1. return the value in *quilc-last-error*; and
  2. set *quilc-last-error* to "".

Obviously no guarantees around thread safety.