cyi-0.9.11

Langue: en

Autres versions - même langue

Version: 369736 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)


BSD mandoc

NAME cyi , cyi-0.9.11

- An interactive interpreter for Curry.

SYNOPSIS

[option ... ] [module ]

DESCRIPTION

is an interactive environment that allows evaluating and debugging Curry goals with respect to a Curry module loaded into the interpreter. At startup, reads and interprets commands from the file .cyirc in the current directory if it exists, or from .cyirc in your home directory otherwise, and then loads either the first module specified on the command line or the Curry prelude.

Goals

A goal is a Curry expression optionally followed by a where-clause, which can be used for providing local definitions for the goal.

All entities exported from the Prelude and the module specified in the last :load command are in scope with unqualified and qualified names unless they are shadowed by one of the declarations from the where-clause. Entities from modules that are imported directly or indirectly from the module specified in the last :load command are also in scope, but only with qualified names.

All free variables of the goal must be declared either in the where-clause or by using a let expression as goal. The bindings of the free variables are displayed together with the normal form of the goal after successful evaluation unless the goal is of type IO t

Commands

At the prompt of the interactive environment, the following commands can be entered:
goal
Evaluate goal in the context of the current module.
:^ [goal ]
Evaluate goal in the context of the current module. If goal is omitted, the previous goal is evaluated again.
:debug [goal ]
Invoke the debugger for goal It may take some time to recompile the source modules with debugging information. If goal is omitted, the debugger is invoked for the previous goal.
:type [goal ]
Print the type of goal instead of evaluating it. If goal is omitted, the type of the previous goal is shown.
:load module
Set the current evaluation context to module This command will compile module and all modules it depends on if necessary. Module can be specified either by the name of its source file (ending in .lcurry or .curry or a plain module name. In the latter case, will look for a source or interface file for module in the current directory and the current search path as determined by the -i and -P options set with the :set command and the environment variable CURRY_IMPORT_PATH

displays the name of the current module in its prompt.

:load
Reset the current evaluation context to the Curry prelude.
:reload
Repeat the last load command.
:freshen
Recompile the current module and all imported source files.
:clean
Remove all compiled files for the current module and all imported source files.
:interface module
Display the interface of module If the environment variable PAGER is set, the interface file is displayed with this command. Otherwise the interface is simply written to the standard output.
:interface
Display the interface of the current module.
:edit file
Invoke the editor for file The default editor is /usr/bin/vi but this can be changed by setting one of the environment variables VISUAL and EDITOR to your preferred editor before starting .
:edit
Edit the source file of the current module.
:set option ...
Add option s to the list of compiler options.
:unset word ...
Remove word s from the list of compiler options.
:cd dir
Change the current directory to dir
:cd
Print the current directory.
:! command
Execute the shell command command
:version
Display the compiler's version.
:help
Show the list of supported commands.
:quit
Quit .

All commands, except for :cd and :clean may be abbreviated to their first letter.

ENVIRONMENT

PAGER
If defined, this commmand is used by the :interface command for displaying module interfaces.
EDITOR
VISUAL
If defined, these environment variables determine the name of the editor command that is invoked instead of /usr/bin/vi by the :edit command. If both environment variables are defined, VISUAL is used.
CURRY_IMPORT_PATH
The environment variable CURRY_IMPORT_PATH contains a colon-separated list of directories that are searched for library modules, which can be loaded with the :load command. The default value is /usr/lib64/curry-0.9.11

FILES

.cyirc
~/.cyirc
Commands from these files are read and interpreted on startup. If both files exist, only .cyirc is used.
~/.cyi_history
The command line history is stored in file ~/.cyi_history

SEE ALSO

cyc(1), cymake(1)

BUGS

is implemented as a shell script which invokes cymake(1) and cyc(1) for compiling modules and goals. Commands are read from the standard input using the shell's builtin read command. Some shells, e.g. /bin/sh on Solaris, cannot read raw input but apply backslash processing to the input. When is executed by such a shell, all backslash characters on the command line must be escaped by another backslash character; i.e., you have to enter rsrsx -> x in a goal instead of rsx -> x and ord 'rsrsn' instead of ord 'rsn' In order to remind you of this limitation, displays the following warning at startup when it is appropriate.
Warning: Backslashes on the command line must be escaped
For instance, use rsrsx -> x for a lambda abstraction
and 'rsrsn' for the linefeed character.

Command line editing and history require support from the read command of the shell, which executes the script. This is available only for Gnu Bash and Korn shells except for the public domain version. Command line editing also works for the Z shell, but without history.

Changing the compiler's search path for library modules with the :set command does not change the search path used by the :load command.