From e381b4b415c86b853ec198620f8dce3ea1f55e38 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 22 Oct 2002 04:38:26 +0000 Subject: [PATCH] fix script documentation :-(. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@649 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- docs/yap.tex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/yap.tex b/docs/yap.tex index 391664dac..c11eaffbd 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -964,7 +964,7 @@ A slightly more sophisticated example is: #!/usr/bin/yap -L # # Hello World script file using Yap -# +# . :- initialization(main). @@ -975,14 +975,18 @@ main :- write('Hello World'), nl. The @code{initialization} directive tells Yap to execute the goal main after consulting the file. Source code is thus compiled and @code{main} -executed at the end. +executed at the end. The @code{.} is useful while debugging the script +as a Prolog program: it guarantees that the syntax error will not +propagate to the Prolog code. -By default, arguments to a script are considered arguments to YAP. As an -example, consider the following script @code{dump_args}: +Notice that the @code{--} is required so that the shell passes the extra +arguments to YAP. As an example, consider the following script +@code{dump_args}: @example @cartouche -#!/usr/bin/yap -L +#!/usr/bin/yap -L -- +#. main( [] ). main( [H|T] ) :-