861 lines
No EOL
18 KiB
HTML
861 lines
No EOL
18 KiB
HTML
<!DOCTYPE HTML>
|
|
<HTML LANG="en-us"
|
|
><HEAD
|
|
><TITLE
|
|
>load | Common Lisp Nova Spec</TITLE
|
|
><META CHARSET="US-ASCII"
|
|
><LINK REL="canonical" HREF="f_load.html"
|
|
><LINK REL="next" HREF="f_with-compilation-unit.html" TYPE="text/html" TITLE="with-compilation-unit"
|
|
><LINK REL="prev" HREF="f_compile-file-pathname.html" TYPE="text/html" TITLE="compile-file-pathname"
|
|
><LINK REL="up" HREF="24_2_System_Construction_Dictionary.html" TYPE="text/html" TITLE="24.2 System Construction Dictionary"
|
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
|
></SCRIPT
|
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
|
></SCRIPT
|
|
></HEAD
|
|
><BODY
|
|
><DIV
|
|
><DIV CLASS="topnav"
|
|
><DIV CLASS="breadcrumb"
|
|
><SPAN CLASS="breadcrumb-item"
|
|
><A HREF="index.html"
|
|
>Common Lisp Nova Spec</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="24_System_Construction.html"
|
|
>24. System Construction</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="24_2_System_Construction_Dictionary.html"
|
|
>24.2 System Construction Dictionary</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="f_load.html"
|
|
>load</A
|
|
></SPAN
|
|
></DIV
|
|
><DIV CLASS="apropos"
|
|
><DIV CLASS="apropos-io"
|
|
><A HREF="f_compile-file-pathname.html" CLASS="prev"
|
|
>←</A
|
|
><SPAN ID="apropos-label"
|
|
>Apropos </SPAN
|
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
|
><A HREF="f_with-compilation-unit.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV ID="apropos-res"
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="matter"
|
|
><DIV CLASS="com"
|
|
><DIV CLASS="begincom"
|
|
><HR
|
|
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
|
|
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="load"
|
|
></SPAN
|
|
><B
|
|
>load</B
|
|
></TD
|
|
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
|
|
><I
|
|
>Function</I
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
></DIV
|
|
><UL CLASS="subtoc"
|
|
></UL
|
|
><DL
|
|
><DT
|
|
><B
|
|
>Syntax</B
|
|
></DT
|
|
><DD
|
|
><TABLE CELLPADDING="0" CELLSPACING="0"
|
|
><TR
|
|
><TD VALIGN="BASELINE" ALIGN="LEFT" NOWRAP="NOWRAP"
|
|
><B
|
|
>load</B
|
|
><SPAN CLASS="cmssi"
|
|
> </SPAN
|
|
><SPAN CLASS="cmssi"
|
|
>filespec</SPAN
|
|
><SPAN CLASS="cmtt"
|
|
> </SPAN
|
|
><SPAN CLASS="cmtt"
|
|
>&key</SPAN
|
|
><SPAN CLASS="cmssi"
|
|
> </SPAN
|
|
></TD
|
|
><TD VALIGN="BASELINE" ALIGN="LEFT"
|
|
><SPAN CLASS="cmssi"
|
|
>verbose</SPAN
|
|
> <SPAN CLASS="cmssi"
|
|
>print</SPAN
|
|
><BR
|
|
><SPAN CLASS="cmssi"
|
|
>if-does-not-exist</SPAN
|
|
> <SPAN CLASS="cmssi"
|
|
>external-format</SPAN
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><DIV
|
|
><SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <SPAN CLASS="cmssi"
|
|
>generalized-boolean</SPAN
|
|
></DIV
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Arguments and Values</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>filespec</VAR
|
|
> — a <A HREF="26_1_Glossary.html#stream"
|
|
><EM CLASS="term"
|
|
>stream</EM
|
|
></A
|
|
>, or a <A HREF="26_1_Glossary.html#pathname_designator"
|
|
><EM CLASS="term"
|
|
>pathname designator</EM
|
|
></A
|
|
>. The default is taken from <A HREF="v_default-pathname-defaults.html" CLASS="varref"
|
|
><B
|
|
>*default-pathname-defaults*</B
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>verbose</VAR
|
|
> — a <A HREF="26_1_Glossary.html#generalized_boolean"
|
|
><EM CLASS="term"
|
|
>generalized boolean</EM
|
|
></A
|
|
>. The default is the <A HREF="26_1_Glossary.html#value"
|
|
><EM CLASS="term"
|
|
>value</EM
|
|
></A
|
|
> of <A HREF="v_load-print.html" CLASS="misc"
|
|
><B
|
|
>*load-verbose*</B
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>print</VAR
|
|
> — a <A HREF="26_1_Glossary.html#generalized_boolean"
|
|
><EM CLASS="term"
|
|
>generalized boolean</EM
|
|
></A
|
|
>. The default is the <A HREF="26_1_Glossary.html#value"
|
|
><EM CLASS="term"
|
|
>value</EM
|
|
></A
|
|
> of <A HREF="v_load-print.html" CLASS="misc"
|
|
><B
|
|
>*load-print*</B
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>if-does-not-exist</VAR
|
|
> — a <A HREF="26_1_Glossary.html#generalized_boolean"
|
|
><EM CLASS="term"
|
|
>generalized boolean</EM
|
|
></A
|
|
>. The default is <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>external-format</VAR
|
|
> — an <A HREF="26_1_Glossary.html#external_file_format_designator"
|
|
><EM CLASS="term"
|
|
>external file format designator</EM
|
|
></A
|
|
>. The default is <SPAN CLASS="kwd"
|
|
><SPAN CLASS="cmtt"
|
|
>:default</SPAN
|
|
></SPAN
|
|
>. </P
|
|
><P CLASS="j"
|
|
><VAR CLASS="param"
|
|
>generalized-boolean</VAR
|
|
> — a <A HREF="26_1_Glossary.html#generalized_boolean"
|
|
><EM CLASS="term"
|
|
>generalized boolean</EM
|
|
></A
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Description</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loads</EM
|
|
></A
|
|
> the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> named by <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> into the Lisp environment. </P
|
|
><P CLASS="j"
|
|
>The manner in which a <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
> is distinguished from a <A HREF="26_1_Glossary.html#compiled_file"
|
|
><EM CLASS="term"
|
|
>compiled file</EM
|
|
></A
|
|
> is <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>. If the file specification is not complete and both a <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
> and a <A HREF="26_1_Glossary.html#compiled_file"
|
|
><EM CLASS="term"
|
|
>compiled file</EM
|
|
></A
|
|
> exist which might match, then which of those files <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> selects is <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
>If <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> is a <A HREF="26_1_Glossary.html#stream"
|
|
><EM CLASS="term"
|
|
>stream</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> determines what kind of <A HREF="26_1_Glossary.html#stream"
|
|
><EM CLASS="term"
|
|
>stream</EM
|
|
></A
|
|
> it is and loads directly from the <A HREF="26_1_Glossary.html#stream"
|
|
><EM CLASS="term"
|
|
>stream</EM
|
|
></A
|
|
>. If <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> is a <A HREF="26_1_Glossary.html#logical_pathname"
|
|
><EM CLASS="term"
|
|
>logical pathname</EM
|
|
></A
|
|
>, it is translated into a <A HREF="26_1_Glossary.html#physical_pathname"
|
|
><EM CLASS="term"
|
|
>physical pathname</EM
|
|
></A
|
|
> as if by calling <A HREF="f_translate-logical-pathname.html" CLASS="funref"
|
|
><B
|
|
>translate-logical-pathname</B
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> sequentially executes each <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>form</EM
|
|
></A
|
|
> it encounters in the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> named by <VAR CLASS="param"
|
|
>filespec</VAR
|
|
>. If the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> is a <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
> and the <A HREF="26_1_Glossary.html#implementation"
|
|
><EM CLASS="term"
|
|
>implementation</EM
|
|
></A
|
|
> chooses to perform <A HREF="26_1_Glossary.html#implicit_compilation"
|
|
><EM CLASS="term"
|
|
>implicit compilation</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> must recognize <A HREF="26_1_Glossary.html#top_level_form"
|
|
><EM CLASS="term"
|
|
>top level forms</EM
|
|
></A
|
|
> as described in <A HREF="3_2_Compilation.html#sec_3_2_3_1" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>3.2.3.1</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Processing</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>of</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Top</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Level</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Forms)</SPAN
|
|
></A
|
|
> and arrange for each <A HREF="26_1_Glossary.html#top_level_form"
|
|
><EM CLASS="term"
|
|
>top level form</EM
|
|
></A
|
|
> to be executed before beginning <A HREF="26_1_Glossary.html#implicit_compilation"
|
|
><EM CLASS="term"
|
|
>implicit compilation</EM
|
|
></A
|
|
> of the next. (Note, however, that processing of <A HREF="f_eval-when.html" CLASS="specref"
|
|
><B
|
|
>eval-when</B
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>forms</EM
|
|
></A
|
|
> by <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> is controlled by the <SPAN CLASS="kwd"
|
|
><SPAN CLASS="cmtt"
|
|
>:execute</SPAN
|
|
></SPAN
|
|
> situation.) </P
|
|
><P CLASS="j"
|
|
>If <VAR CLASS="param"
|
|
>verbose</VAR
|
|
> is <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> prints a message in the form of a comment (<I CLASS="i"
|
|
><I
|
|
>i.e.</I
|
|
></I
|
|
>, with a leading <A HREF="26_1_Glossary.html#semicolon"
|
|
><EM CLASS="term"
|
|
>semicolon</EM
|
|
></A
|
|
>) to <A HREF="26_1_Glossary.html#standard_output"
|
|
><EM CLASS="term"
|
|
>standard output</EM
|
|
></A
|
|
> indicating what <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> is being <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loaded</EM
|
|
></A
|
|
> and other useful information. If <VAR CLASS="param"
|
|
>verbose</VAR
|
|
> is <A HREF="26_1_Glossary.html#false"
|
|
><EM CLASS="term"
|
|
>false</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> does not print this information. </P
|
|
><P CLASS="j"
|
|
>If <VAR CLASS="param"
|
|
>print</VAR
|
|
> is <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> incrementally prints information to <A HREF="26_1_Glossary.html#standard_output"
|
|
><EM CLASS="term"
|
|
>standard output</EM
|
|
></A
|
|
> showing the progress of the <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loading</EM
|
|
></A
|
|
> process. For a <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
>, this information might mean printing the <A HREF="26_1_Glossary.html#value"
|
|
><EM CLASS="term"
|
|
>values</EM
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#yield"
|
|
><EM CLASS="term"
|
|
>yielded</EM
|
|
></A
|
|
> by each <A HREF="26_1_Glossary.html#form"
|
|
><EM CLASS="term"
|
|
>form</EM
|
|
></A
|
|
> in the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> as soon as those <A HREF="26_1_Glossary.html#value"
|
|
><EM CLASS="term"
|
|
>values</EM
|
|
></A
|
|
> are returned. For a <A HREF="26_1_Glossary.html#compiled_file"
|
|
><EM CLASS="term"
|
|
>compiled file</EM
|
|
></A
|
|
>, what is printed might not reflect precisely the contents of the <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
>, but some information is generally printed. If <VAR CLASS="param"
|
|
>print</VAR
|
|
> is <A HREF="26_1_Glossary.html#false"
|
|
><EM CLASS="term"
|
|
>false</EM
|
|
></A
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> does not print this information. </P
|
|
><P CLASS="j"
|
|
>If the file named by <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> is successfully loaded, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> returns <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
>If the file does not exist, the specific action taken depends on <VAR CLASS="param"
|
|
>if-does-not-exist</VAR
|
|
>: if it is <SPAN CLASS="misc"
|
|
><B
|
|
>nil</B
|
|
></SPAN
|
|
>, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> returns <SPAN CLASS="misc"
|
|
><B
|
|
>nil</B
|
|
></SPAN
|
|
>; otherwise, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> signals an error. </P
|
|
><P CLASS="j"
|
|
>The <VAR CLASS="param"
|
|
>external-format</VAR
|
|
> specifies the <A HREF="26_1_Glossary.html#external_file_format"
|
|
><EM CLASS="term"
|
|
>external file format</EM
|
|
></A
|
|
> to be used when opening the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> (see the <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>function</EM
|
|
></A
|
|
> <A HREF="f_open.html" CLASS="funref"
|
|
><B
|
|
>open</B
|
|
></A
|
|
>), except that when the <A HREF="26_1_Glossary.html#file"
|
|
><EM CLASS="term"
|
|
>file</EM
|
|
></A
|
|
> named by <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> is a <A HREF="26_1_Glossary.html#compiled_file"
|
|
><EM CLASS="term"
|
|
>compiled file</EM
|
|
></A
|
|
>, the <VAR CLASS="param"
|
|
>external-format</VAR
|
|
> is ignored. <A HREF="f_compile-file.html" CLASS="funref"
|
|
><B
|
|
>compile-file</B
|
|
></A
|
|
> and <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> cooperate in an <A HREF="26_1_Glossary.html#implementation-dependent"
|
|
><EM CLASS="term"
|
|
>implementation-dependent</EM
|
|
></A
|
|
> way to assure the preservation of the <A HREF="26_1_Glossary.html#similarity"
|
|
><EM CLASS="term"
|
|
>similarity</EM
|
|
></A
|
|
> of <A HREF="26_1_Glossary.html#character"
|
|
><EM CLASS="term"
|
|
>characters</EM
|
|
></A
|
|
> referred to in the <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
> at the time the <A HREF="26_1_Glossary.html#source_file"
|
|
><EM CLASS="term"
|
|
>source file</EM
|
|
></A
|
|
> was processed by the <A HREF="26_1_Glossary.html#file_compiler"
|
|
><EM CLASS="term"
|
|
>file compiler</EM
|
|
></A
|
|
> under a given <A HREF="26_1_Glossary.html#external_file_format"
|
|
><EM CLASS="term"
|
|
>external file format</EM
|
|
></A
|
|
>, regardless of the value of <VAR CLASS="param"
|
|
>external-format</VAR
|
|
> at the time the <A HREF="26_1_Glossary.html#compiled_file"
|
|
><EM CLASS="term"
|
|
>compiled file</EM
|
|
></A
|
|
> is <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loaded</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> binds <A HREF="v_readtable.html" CLASS="varref"
|
|
><B
|
|
>*readtable*</B
|
|
></A
|
|
> and <A HREF="v_package.html" CLASS="varref"
|
|
><B
|
|
>*package*</B
|
|
></A
|
|
> to the values they held before <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loading</EM
|
|
></A
|
|
> the file. </P
|
|
><P CLASS="j"
|
|
><A HREF="v_load-pathname.html" CLASS="varref"
|
|
><B
|
|
>*load-truename*</B
|
|
></A
|
|
> is <A HREF="26_1_Glossary.html#bound"
|
|
><EM CLASS="term"
|
|
>bound</EM
|
|
></A
|
|
> by <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> to hold the <A HREF="26_1_Glossary.html#truename"
|
|
><EM CLASS="term"
|
|
>truename</EM
|
|
></A
|
|
> of the <A HREF="26_1_Glossary.html#pathname"
|
|
><EM CLASS="term"
|
|
>pathname</EM
|
|
></A
|
|
> of the file being <A HREF="26_1_Glossary.html#load"
|
|
><EM CLASS="term"
|
|
>loaded</EM
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
><A HREF="v_load-pathname.html" CLASS="varref"
|
|
><B
|
|
>*load-pathname*</B
|
|
></A
|
|
> is <A HREF="26_1_Glossary.html#bound"
|
|
><EM CLASS="term"
|
|
>bound</EM
|
|
></A
|
|
> by <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> to hold a <A HREF="26_1_Glossary.html#pathname"
|
|
><EM CLASS="term"
|
|
>pathname</EM
|
|
></A
|
|
> that represents <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> merged against the defaults. That is, <SPAN CLASS="cmtt"
|
|
>(pathname</SPAN
|
|
> <SPAN CLASS="cmtt"
|
|
>(merge-pathnames</SPAN
|
|
> <VAR CLASS="param"
|
|
>filespec</VAR
|
|
><SPAN CLASS="cmtt"
|
|
>))</SPAN
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Examples</B
|
|
></DT
|
|
><DD
|
|
><PRE CLASS="screen"
|
|
>;Establish a data file...
|
|
(with-open-file (str "data.in" :direction :output :if-exists :error)
|
|
(print 1 str) (print '(setq a 888) str) t)
|
|
<SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> T
|
|
(load "data.in") <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>
|
|
a <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> 888
|
|
(load (setq p (merge-pathnames "data.in")) :verbose t)
|
|
; Loading contents of file /fred/data.in
|
|
; Finished loading /fred/data.in
|
|
<SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>
|
|
(load p :print t)
|
|
; Loading contents of file /fred/data.in
|
|
; 1
|
|
; 888
|
|
; Finished loading /fred/data.in
|
|
<SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
></PRE
|
|
><PRE CLASS="screen"
|
|
>;----[Begin file SETUP]----
|
|
(in-package "MY-STUFF")
|
|
(defmacro compile-truename () `',*compile-file-truename*)
|
|
(defvar *my-compile-truename* (compile-truename) "Just for debugging.")
|
|
(defvar *my-load-pathname* *load-pathname*)
|
|
(defun load-my-system ()
|
|
(dolist (module-name '("FOO" "BAR" "BAZ"))
|
|
(load (merge-pathnames module-name *my-load-pathname*))))
|
|
;----[End of file SETUP]----
|
|
|
|
|
|
(load "SETUP")
|
|
(load-my-system)</PRE
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Affected By</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>The implementation, and the host computer’s file system.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>Exceptional Situations</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
>If <SPAN CLASS="kwd"
|
|
><SPAN CLASS="cmtt"
|
|
>:if-does-not-exist</SPAN
|
|
></SPAN
|
|
> is supplied and is <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>, or is not supplied, <A HREF="f_load.html" CLASS="funref"
|
|
><B
|
|
>load</B
|
|
></A
|
|
> signals an error of <A HREF="26_1_Glossary.html#type"
|
|
><EM CLASS="term"
|
|
>type</EM
|
|
></A
|
|
> <A HREF="t_file-error.html" CLASS="typeref"
|
|
><B
|
|
>file-error</B
|
|
></A
|
|
> if the file named by <VAR CLASS="param"
|
|
>filespec</VAR
|
|
> does not exist, or if the <A HREF="26_1_Glossary.html#file_system"
|
|
><EM CLASS="term"
|
|
>file system</EM
|
|
></A
|
|
> cannot perform the requested operation. </P
|
|
><P CLASS="j"
|
|
>An error of <A HREF="26_1_Glossary.html#type"
|
|
><EM CLASS="term"
|
|
>type</EM
|
|
></A
|
|
> <A HREF="t_file-error.html" CLASS="typeref"
|
|
><B
|
|
>file-error</B
|
|
></A
|
|
> might be signaled if <CODE CLASS="f"
|
|
>(wild-pathname-p <VAR CLASS="param"
|
|
>filespec</VAR
|
|
>)</CODE
|
|
> returns <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>.</P
|
|
></DD
|
|
><DT
|
|
><B
|
|
>See Also</B
|
|
></DT
|
|
><DD
|
|
><P CLASS="j"
|
|
><A HREF="f_error.html" CLASS="funref"
|
|
><B
|
|
>error</B
|
|
></A
|
|
>, <A HREF="f_merge-pathnames.html" CLASS="funref"
|
|
><B
|
|
>merge-pathnames</B
|
|
></A
|
|
>, <A HREF="v_load-print.html" CLASS="varref"
|
|
><B
|
|
>*load-verbose*</B
|
|
></A
|
|
>, <A HREF="v_default-pathname-defaults.html" CLASS="varref"
|
|
><B
|
|
>*default-pathname-defaults*</B
|
|
></A
|
|
>, <A HREF="t_pathname.html" CLASS="typeref"
|
|
><B
|
|
>pathname</B
|
|
></A
|
|
>, <A HREF="t_logical-pathname.html" CLASS="typeref"
|
|
><B
|
|
>logical-pathname</B
|
|
></A
|
|
>, <A HREF="20_1_File_System_Concepts.html#sec_20_1" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>20.1</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(File</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>System</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Concepts)</SPAN
|
|
></A
|
|
>, <A HREF="19_1_Overview_of_Filenames.html#sec_19_1_2" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>19.1.2</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Pathnames</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>as</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Filenames)</SPAN
|
|
></A
|
|
></P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="footer"
|
|
><DIV CLASS="btmnav"
|
|
><A HREF="f_compile-file-pathname.html" CLASS="prev"
|
|
>←</A
|
|
><A HREF="f_with-compilation-unit.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV CLASS="trail"
|
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
|
></DIV
|
|
></DIV
|
|
><SCRIPT
|
|
>domReady();</SCRIPT
|
|
></BODY
|
|
></HTML
|
|
> |