Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Actually, if I understood the HyperSpec correctly, in theory a conformant Common Lisp implementation would be allowed to just crash if you declared that x is a list and then you call it with something else. By declaring the type like this, you're telling the compiler: "I assure you that x will definitely be a list".

Of course, in practice implementations like to check everything by default.



The compilation parameters speed and safety will determine what happens when something goes wrong.

For example, the following global settings would be considered fast but dangerous :

  (declaim (optimize 
     (speed 3) (compilation-speed 0) (safety 0) (debug 0)))
These would be safe but slower :

  (declaim (optimize 
     (speed 0) (compilation-speed 0) (safety 3) (debug 3)))




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: