fix script documentation :-(.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@649 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
593162243d
commit
e381b4b415
14
docs/yap.tex
14
docs/yap.tex
@ -964,7 +964,7 @@ A slightly more sophisticated example is:
|
|||||||
#!/usr/bin/yap -L
|
#!/usr/bin/yap -L
|
||||||
#
|
#
|
||||||
# Hello World script file using Yap
|
# Hello World script file using Yap
|
||||||
#
|
# .
|
||||||
|
|
||||||
:- initialization(main).
|
:- initialization(main).
|
||||||
|
|
||||||
@ -975,14 +975,18 @@ main :- write('Hello World'), nl.
|
|||||||
|
|
||||||
The @code{initialization} directive tells Yap to execute the goal main
|
The @code{initialization} directive tells Yap to execute the goal main
|
||||||
after consulting the file. Source code is thus compiled and @code{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
|
Notice that the @code{--} is required so that the shell passes the extra
|
||||||
example, consider the following script @code{dump_args}:
|
arguments to YAP. As an example, consider the following script
|
||||||
|
@code{dump_args}:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@cartouche
|
@cartouche
|
||||||
#!/usr/bin/yap -L
|
#!/usr/bin/yap -L --
|
||||||
|
#.
|
||||||
|
|
||||||
main( [] ).
|
main( [] ).
|
||||||
main( [H|T] ) :-
|
main( [H|T] ) :-
|
||||||
|
Reference in New Issue
Block a user