summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-08-16 09:36:36 +0000
committersimonmar <unknown>2002-08-16 09:36:36 +0000
commit1f35e3ac4ac5b74cdeb30058bc01ab36766b25c8 (patch)
tree5e4e4df82e0a79384a57263f225d814ed6968809
parentbdc74564dfbae62c9f3d1766872634edf2cc4ccc (diff)
downloadhaskell-1f35e3ac4ac5b74cdeb30058bc01ab36766b25c8.tar.gz
[project @ 2002-08-16 09:36:36 by simonmar]
Be a bit clearer about the current directory when GHCi is started, and mention that you might have to ':cd' to the right place before you can load something.
-rw-r--r--ghc/docs/users_guide/ghci.sgml21
1 files changed, 19 insertions, 2 deletions
diff --git a/ghc/docs/users_guide/ghci.sgml b/ghc/docs/users_guide/ghci.sgml
index 0919b20394..54952ecdb3 100644
--- a/ghc/docs/users_guide/ghci.sgml
+++ b/ghc/docs/users_guide/ghci.sgml
@@ -102,8 +102,7 @@ Prelude>
<title>Loading source files</title>
<para>Suppose we have the following Haskell source code, which we
- place in a file <filename>Main.hs</filename> in the current
- directory:</para>
+ place in a file <filename>Main.hs</filename>:</para>
<programlisting>
main = print (fac 20)
@@ -112,6 +111,24 @@ fac 0 = 1
fac n = n * fac (n-1)
</programlisting>
+ <para>You can save <filename>Main.hs</filename> anywhere you like,
+ but if you save it somewhere other than the current
+ directory<footnote><para>If you started up GHCi from the command
+ line then GHCi's current directory is the same as the current
+ directory of the shell from which it was started. If you started
+ GHCi from the &ldquo;Start&rdquo; menu in Windows, then the
+ current directory is probably something like
+ <filename>C:\Documents and Settings\<replaceable>user
+ name</replaceable></filename>.</para> </footnote> then we will
+ need to change to the right directory in GHCi:</para>
+
+<screen>
+Prelude> :cd <replaceable>dir</replaceable>
+</screen>
+
+ <para>where <replaceable>dir</replaceable> is the directory (or
+ folder) in which you saved <filename>Main.hs</filename>.</para>
+
<para>To load a Haskell source file into GHCi, use the
<literal>:load</literal> command:</para>
<indexterm><primary><literal>:load</literal></primary></indexterm>