Next: , Previous: Compiling And Linking, Up: Compiling with Hobbit


2.2 Error Detection

Error detection during compilation is minimal. In case your scheme code is syntactically incorrect, hobbit may crash with no sensible error messages or it may produce incorrect C code.

Hobbit does not insert any type-checking code into the C output it produces. Eg, if a hobbit-compiled program applies ‘car’ to a number, the program will probably crash with no sensible error messages.

Thus it is strongly suggested to compile only throughly debugged scheme code.

Alternatively, it is possible to compile all the primitives into calls to the SCM procedures doing type-checking. Hobbit will do this if you tell it to assume that all the primitives may be redefined. Put

     (define compile-all-proc-redefined #t)

anywhere in top level of your scheme code to achieve this.

Note Bene: The compiled code using

     (define compile-all-proc-redefined #t)

will typically be much slower than one produced without using

     (define compile-all-proc-redefined #t).

All errors caught by hobbit will generate an error message

     COMPILATION ERROR:
     <description of the error>

and hobbit will immediately halt compilation.