Ascend FD-23R Manual de usuario Pagina 19

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 81
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 18
1.3. Interpreter Commands 7
1.3.1 Calls to the Operating System (OS)
Some commands calls directly to the operating system, as for example the following:
/help. or /h.
Show a brief help menu;
/cd(< dir >) changes the TOY(FD) working directory to the directory < dir >;
/system(< comm >) sends the command < comm > to the OS (i.e., to the
corresponding shell). This is the most direct way that TOY(FD) provides to
communicate with the OS. For example, the command /cd(< dir >) can be
obtained as /system(’cd < dir >’). Another example is:
/system(’cp my_program.toy /home/users/axterix/examples/.’).
/q, /quit, /e or /exit terminate the TOY(FD) session.
1.3.2 Compiling and Running TOY(FD) Programs
By default, the extension of TOY(FD) programs is .toy’, that is to say, the same
extension than classical TOY programs (remember that TOY is part of TOY(FD) ).
Any reference to a source program without explicit extension will be completed with the
extension .toy’. The compilation of a TOY(FD) program (e.g., file.toy) generates
a SICStus Prolog program (e.g., file.pl).
Before loading a TOY(FD) program, the file containing this TOY(FD) program has
to be compiled. Then after a correct compilation, the SICStus file generated from this
compilation can be loaded and the user is ready to execute goals. Of course, this
process is transparent to the user and is simplified via the following three commands:
/compile(< file >) compiles the archive < file > (or < file >.toy if no
extension is provided) and generates the archive < f ile >.pl. This archive is
not compiled by SICStus and, as a consequence, no goal can be solved at the end
of this process.
/load(< file >) loads the program < file >.pl, previously compiled by
TOY(FD). In fact, this command asks SICStus to compile the Prolog program
generated by TOY(FD) after executing the previous command.
When, via a new program, a definition for a function previously used in the cur-
rent TOY(FD) session is redefined, TOY(FD) (via Sicstus) will show the following
message
The procedure Name/Arity is being redefined.
Old file: ...
New file: ...
Do you really want to redefine it? (y, n, p, or ?)
Vista de pagina 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 80 81

Comentarios a estos manuales

Sin comentarios