Getting Started

This Pnuts User's Guide describes basic usage of Pnuts environment. Readers will learn what kind of functions are available and how to integrate Pnuts into Java applications.

This section explains some prerequisites to read the rest of the guide.

Runtime Environment

Pnuts runs on JRE (Java Runtime Environment) version 1.1 or later. The Pnuts distribution does not include JRE, which means that you need to install a JRE (or JDK) in your computer before using Pnuts. If you have two or more JREs installed, you can pick one to use Pnuts every time you start a Pnuts interpreter by changing environment variables.

The pnuts.jar file is necessary to run the Pnuts interpreter. Also a shell script or a batch file is usually used to start it up. The pnuts.jar file contains standard scripts, which are described later, and classes in Pnuts API . Pnuts API is used to implement the pnuts command, in addition, developers can call them directly to incorporate the Pnuts' functionality into their applications.

Functions

Pnuts functions fall into two categories: built-in functions and others. It is important to distinguish them. Built-in functions are guaranteed to be available even when initialization script is not loaded and it is not permissible to re-define them. The Language Specification defines the built-in functions.

Non-builtin Functions can be grouped into modules, which is described later.

Convensions of This Guide

The User's Guide follows the following convension to show the usage of a function in a bounding box.

loadFile( String fileName )

This example shows that a function called 'loadFile' takes one parameter of String type.

When a function is overloaded, the possible signatures are connected with the word ' or '.

write(byte[] array , int offset , int length) or
(char[] array , int offset , int length)
An example of multiple signatures

When a function has an optional parameter, a pair of curly brace { } is used to indicate that it can be specified optionally.

open(String fileName {, String mode })
An example of optional Parameters

When a parameter is an array type, the component type may be omitted.

sort(array [ ] )


Back