Go Backlanguage indexhome pagesearch this site
click on home button to open mainpage

TRAC

1975, USA


mooers_calvin.GIF (34143 bytes)
Calvin M. Mooers


papers & manuals
principal papers.

software
.

keywords

Description

TRAC(2) Language Fundamentals

TRAC is an interpretive, recursive, string-based, macroprocessing language with no compile step. There are up to now three versions of TRAC(2) recognized by the TRAC Foundation.

The language employs a single data type, strings of eight bit byte, or octet, characters. String storage is dynamic, with continuous garbage collection. Strings may be of any length within the capacity of the allocated memory. Strings are treated interchangeably as both data and executable expressions.

Actions in TRAC are commanded by primitive expressions in a mathematical function form. Expressions are executed from inside to outside, from left to right. After execution, each primitive is replaced by the value string resulting from its execution, giving TRAC its recursive structure.

TRAC language is highly interactive, and entire subroutines can be inserted, or deleted, from a running procedure, thus massively changing the behavior during runtime. TRAC macros can call other macros, generate and define new macros, or delete other macros, with no limit to the depth of calls.

TRAC language arithmetic is decimal and integer only, and the number representation is by digit strings. From this base, other numeric types can be constructed by means of TRAC language procedures. TRAC provides procedures to display and manipulate eight bit octets of data.

 

Example TRAC Code

The following is a TRAC T84 script to compute Fibonacci numbers.

:(s,fibo,(
:(ei,<1>, 1, 0,(
:(ei,<1>, 2, 1,(
:(aa, :(ri,fibo,:(as, <1>,1)),:(ri,fibo,:(as, <1>,2)))
))
))
))`
:(mw,fibo)'

To use this script to compute the nth Fibonacci number (where n is a
positive integer) type:

:(ri,fibo,n)'


For example, to compute the 3rd Fibonacci number:

:(ri,fibo,3)'3

Language Specifications

see above

 

Chronology

 

 

 

 

bar

Go Back Last Updated on August 26, 2002 For suggestions please mail the editors 


Footnotes & References