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

load time conditional



I've tried the following code in MACL 1.3.2 to achieve a 
load time conditional defun. This code works fine with
the source file, but not with the compiled 'FASL' file.
Is there another possibility to achieve a load time
conditionalisation? 

;File # foo
(eval-when (load eval compile)
  #+bar
  (defun foo ()
    "www")
  
  #-bar
  (defun foo ()
    "qqqq")
  
  )
;End file # foo

;sample use
(setq  *features* (delete 'bar *features*))
(load "# foo")
(foo)  ; --> "qqq"

(pushnew 'bar *features*)
(load "# foo")
(foo)  ;--> "www"

(compile-file "# foo")

(load "# foo.fasl")
(foo)  ; --> "www"

(setq  *features* (delete 'bar *features*))
(load "# foo.fasl")
(foo)  ; --> "www" But should be "qqq"


Karsten Poeck
Institute of Logic
University of Karlsruhe
e-mail poeck@ira.uka.de