[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: in defense of C



In article <542@fsu.scri.fsu.edu> pepke@gw.scri.fsu.edu (Eric Pepke) writes:
|In the one I am now writing for the 680x0, one can have 
|safe CARs and CDRs without loss of speed.
|So, one just makes that a test for 
|(1) a valid list, or (2) anything else.  In my system, that's testing a 
|single bit.  In case 1, do the job.  In case 2, return NIL.
|Eric Pepke                                    INTERNET: pepke@gw.scri.fsu.edu

But this is NOT safe: consider the following code:

(defun foo ()
  (if (car 3)
      (tear-down-the-berlin-wall)
      (bomb-the-soviets)))

Your implementation will bomb the soviets! I understand that your
implementation will not crash due to garbage pointers, but I
don't think "safe" is a good term to apply here.

John
gateley@m2.csc.ti.com