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

Re: What #+rmhackery a good idea #-rmhackery utter nonsense



Sorry, my message was a bit too #+:-).

Examples of code that don't use #+ and #-:

(if (status 'lispm) 
     (progn ... 20 pages of lispm code ...))

(if (not (status 'lispm))
    (progn ... 20 pages of generic CL code ...))


I'd prefer
(defun hairy-thing ()
  (if (status 'lispm) (compute-hairy-thing-for-LispM)
                      (compute-generic-hairy-thing))

but if you insist:

(defmacro const (x) `',(eval x))

(defun hairy-thing ()
  (cond
    ((status 'lispm) (const (compute-hairy-thing-for-LispM))
    (t               (const (compute-generic-hairy-thing))))