1

Can anyone please tell me after compiling and loading a file do we still have to define the function(already in the file compiled and loaded) in repl to use it? or is there still process left so that the repl detects the function is already defined?

What is the significance of loading a file in lisp?

Thanks.

1 Answer 1

4

If the file contents have been read in, then, assuming there have been no errors thrown, all the forms of the contents have been executed. If one of those is a DEFUN form, then the function will have been defined.

To be precise, examine the LOAD definition in the HyperSpec.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks @paul nathan.will the repl detect the function?I have 0 errors and 0 warnings
Unless there's an in-package in that file, yes. If there is an (in-package :foo) in the file, you will need to use (foo:bar) or (foo::bar) depending on whether bar is exported.
@krzysz00 Or use an (in-package :foo) to set the REPL's idea of the current package to the package foo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.