[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clisp problem -- detecting a function
- To: clisp-list@ma2s2.mathematik.uni-karlsruhe.de
- Subject: Re: Clisp problem -- detecting a function
- From: haible (Bruno Haible)
- Date: Fri, 3 Jun 94 18:20:19 +0200
> Does anybody know how I can create a conditional statement based on
> whether a function foo been defined or not?
> (unless (fboundp 'foo)
> (load "file-containing-foo"))
This is fine for interpreted code, but when compiling files the compiler
does not "know" that it should look at "file-containing-foo" as well.
Better use PROVIDE and REQUIRE, like this:
(eval-when (compile load eval)
(when (fboundp 'foo)
(pushnew ':HAVE-FOO *features*)
) )
#-HAVE-FOO (require 'module-foo "file-containing-foo")
Bruno Haible