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

Re: Clisp problem -- detecting a function



> 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