© Copyright 2001 Handwave Inc., All Rights Reserved
Handscript 1.0 to 2.0 Conversion Guide
Overview
Significant new features have been introduced into Handscript 2.0, but modifications to 1.0 code may be necessary. This document identifies the major changes. See Handscript.pdf for complete specification of the Handscript language.
Base Modules Introduced
The concept of "base" Poplet modules is introduced. There are 13 base modules contained within the PopletKit PRC database. These modules cannot be changed. Their source code can be viewed with the Poplet Kit. In the Poplet Module Hierarchy form, base modules are marked with an asterisk.
The base modules are: Application, Array, C, Clip, Date, Math, Number, Object, OS, String, Undefined, URL and Window.
Built-in Functions are Removed
Handscript 1.0 had the concept of built-in functions in the following pseudo modules: c, lang, str and user.
These pseudo modules are eliminated from the 2.0 language and are
replaced by some of the base modules described above.
The problem with the pseudo modules was that they were not implemented in Handscript and there was no source code to browse.
In Handscript 2.0, calls to these pseudo modules (e.g., user.menu(m)) appear to be calls to the value undefined,
since the module name has the syntax of an uninitialized local variable.
Objects Introduced
Handscript 2.0 introduces objects and a module hierarchy, with inheritance. See the language specification for the complete information.
Variable Function Call Changed
The syntax of calling a function with a variable name changed in Handscript 2.0. An example of a variable call in 2.0 syntax is the following:
names = {"sin", "cos", "tan"}; //the names of functions to call
name = names[ i ]; //pick a name
y = Math[name](x); //call the variable function in the Math module