Reference

cyi(1)

interactive interpreter for Zinc.

NAME

cyi – interactive interpreter for Zinc.

SYNOPSIS

cyi [option ...] [module]

DESCRIPTION

cyi is an interactive environment that allows evaluating and debugging Zinc goals with respect to a Zinc module loaded into the interpreter. At startup, cyi loads either the module specified on the command line or the Zinc prelude.

Goals

A goal is a Zinc expression optionally followed by a where-clause that can be used for providing local definitions for the goal. 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.

:debug goal

Invoke the debugger for goal. It may take some time to recompile the source modules with debugging information.

:type goal

Print the type of goal instead of evaluating it.

:load module

Set the current evaluation context to module. This command will compile module and all modules it depends on. The module can be specified either by the name of its source file (ending in .lcurry or .curry) or a plain module name. cyi 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.

: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 cyi.

:edit

Edit the source file of the current module.

:set option ...

Use options when compiling modules.

:set

Display the current set of compiler options.

:unset

Reset all 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 cyi.

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

SEE ALSO

cyc(1), cymake(1)

BUGS

cyi 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 cyi is executed under such a shell, all backslash characters on the command line must be escaped by another backslash character; i.e., you have to enter \\x -> x in a goal instead of \x -> x and ord '\\n' instead of ord '\n'. In order to remind you of this limitation, cyi displays the following warning at startup when it is appropriate.

Warning: Backslashes on the command line must be escaped

  For instance, use \\x -> x for a lambda abstraction

  and '\\n' for the linefeed character.

AUTHOR

This man page was written by Wolfgang Lux for the Muenster Curry Compiler, and later adapted by Diego Berrueta to the Zinc Project.