Manual page for the plang command

SYNOPSIS

plang [options] [filename.lp [arguments ...]]

DESCRIPTION

The plang command is used to run applications that are written in the Plang logic programming language. The command-line starts with a list of options for the plang command itself. The options are followed by the name of the *.lp source file to be executed. The remaining arguments are passed to the main predicate of filename.lp.

OPTIONS

-I dir
--import=dir

Adds dir to the list of directories to search for imports when processing an import/1 directive. The directories added by the -I option will be searched before the predefined system import directories.

-L dir
--import-lib=dir

Adds dir to the list of directories to search for import libraries when processing a load_library/1 directive. The directories added by the -L option will be searched before the predefined system import library directories.

-m name
--main=name

Sets name as the main entry point predicate to be executed. The default is main. The predicate is assumed to take a single parameter corresponding to the list [filename.lp, arguments, ...].

SHELL MODE

If the filename.lp and arguments are omitted, then plang will enter "shell mode". A brief introductory header is displayed, and then the user is prompted to enter Plang expressions for evaluation:

$ plang
Plang version 0.0.1
Copyright (c) 2011 Southern Storm Software, Pty Ltd.
Type 'help.' for help

| ?-

Shell mode stops when the user types "exit." or "quit.", or otherwise causes an end-of-file indication on standard input.

EXECUTABLE MODE

Under Unix-like systems such as GNU/Linux, it is possible to mark filename.lp as an executable with chmod +x. Add the following line to the top of filename.lp:

#!/usr/bin/env plang

After that, the Plang application can be run directly:

$ ./filename.lp

SEE ALSO

Plang language manual.

DIAGNOSTICS

The exit status will be zero if filename.lp was loaded without error and the main predicate completed successfully. The exit status will be 1 if a load error occurred, the main predicate failed, or an uncaught error was thrown using throw/1. If the application executes halt/0 or halt/1, then the exit status will be set accordingly.


Generated on 26 May 2011 for plang by  doxygen 1.6.1