I'd like to include code from another source file. Does anyone know how to do that?
相关问题
- What is the best way to do a search in a large fil
- Creating a SPARQL parameterized query using append
- Spring Integration - Inbound file endpoint. How to
- php--glob for searching directories and .jpg only
- How to include FFI in OS X?
相关文章
- What are the problems associated to Best First Sea
- What is the correct way to declare and use a FILE
- How can I fix this circular predicate in Prolog?
- Making new files automatically executable?
- How to serialize data into indented json [duplicat
- How to negate in Prolog
- Creating a custom file like object python suggesti
- Identify which file has included some particular h
If you want to include the file literally - similar to #include, use :- include('file.pl').
Most of the time it is preferable to structure your program using modules, though.
If your file is called
foo.pl
, you can include it usingor, equivalently and a bit more explicit
or, if you're worried it may be loaded several times in a larger app
or, if you're using full-blown modules
though the exact name of the last predicate differs between Prolog versions.