Jcon Language Differences

The core Icon language is defined by The Icon Programming Language, Third Edition (Griswold and Griswold, 1996). This section documents differences with respect to that book and to the reference implementation, Version 9 of Icon. Differences related to graphics are described in the Graphics section.

Characters and Strings

Like Version 9 of Icon, Jcon uses an 8-bit superset of ASCII. Jcon does not use Java's Unicode character set.

Conversion of real numbers to strings produces more digits than Version 9.

Files

Standard error output (&errout) is always unbuffered.

The standard files &input, &output, and &errout cannot be accessed randomly using seek() and where().

Processes run by system(s) or open(s,"p") do not inherit &input, &output, and &errout. Except for the case of open(s,"wp"), where it is provided by the program, &input is always empty. The two output files, &output and &errout, are copied from the process after it terminates.

Other Data Types

Random selection from sets and tables differs from Version 9, even with the same random seed.

Jcon is not always consistent with Version 9 when it encounters large integers in unsupported contexts such as subscripting.

Subscripting

Version 9 of Icon allows wrap-around subscripting of strings and lists, for example s[-3+:5]. This is arguably an implementation error, and such expressions fail in Jcon.

Keywords

&features includes "Java". A corresponding preprocessor symbol _JAVA is predefined.

&time produces elapsed wall-clock time, not CPU time, if getCurrentThreadCpuTime() is not supported by the Java host.

&progname is not assignable.

&allocated, &collections, &storage, and &regions produce only zero values.

Built-in Functions

The functions chdir(), getch(), getche(), and kbhit() are not implemented.

The implementation of loadfunc() is described in the Dynamic Loading section.

Procedures returned by proc(s,i) always dereference their arguments. Version 9 produces procedures that can alter their arguments for calls such as proc(":=",2).

Linking

link directives must give a simple name, not a path.

Under Jcon, any reference to a procedure renders it invocable (callable by string invocation). In version 9, only procedures reachable from main() are made invocable by default.

Debugging

Most debugging features require compilation with the -f d switch. Programs compiled with default options cannot be traced, cannot use error conversion (&error), and produce an abridged traceback if an error occurs.

Only global variables are available to variable(), display(), and &dump.


index || intro | usage | differences | graphics | dynamic loading | performance | release notes | installation | references || home