help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Keeping run-time code from running at compile-time


From: rgb
Subject: Re: Keeping run-time code from running at compile-time
Date: 7 Oct 2005 09:45:58 -0700
User-agent: G2/0.2

> (defun foo ()
>   (error "Shouldn't hit this when compiling"))
> (foo)

You are explicitly invoking foo here.
The only difference between (defun ...) and (foo ...) in
any file that you require or load is in your mind.
They are just functions to be executed.  Lisp doesn't
care if they are named def<something> or not.

> (provide 'a)
>
> (require 'a)
> (defun doit ()
>   (message "%s" "Hello, world!"))
>

To achieve what you seem to want you need:

---x---
(defun foo ()
  (error "Shouldn't hit this when compiling"))
(provide 'x)
---a---
(require 'x)
(foo)
(provide 'a)
---b---
> (require 'x)
> (defun doit ()
>   (message "%s" "Hello, world!"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]