Transd Reference Manual

(Work in progress)


Transd programming language

Transd is a general purpose programming language, statically typed, multi-paradigm, with meta-compilation execution model. Its defining features are its novel execution model, which doesn't require the compilation to machine code, but at the same time is considerably faster than traditional interpretation technics, and, secondly, the ultimate compactness of implementation, which makes it an ideal choice for embeddable or extension language.



Lexical conventions

Transd source files are encoded in UTF-8. Upper and lower character cases are distinguished.

Source files can contain comments, which can be marked by one of two ways:

  1. Character sequence // (slash, slash) anywhere on a line marks the start of a comment which extends to the end of the line.
  2. Character sequence /* (slash, asterisk) marks the start of a comment which extends to the nearest character sequence */ (asterisk, slash). All characters between two slashes included are replaced with one whitespace character. (For example, a sequence A/*B, B*/A will be treated as A A.

Identifiers in Transd can be any string of letters, digits, and underscores, not beginning with a digit. Letter is any symbol considered alphabetic under the current locale.

The formal syntax of language parts in this manual is described using a variant of Backus-Naur Form (BNF) specification.

A BNF specification is a set of derivation rules, written as

 symbol := __expression__

where symbol is a non-terminal, and the __expression__ consists of one or more sequences of symbols. The ":=" means that the symbol on the left must be replaced with the expression on the right. The vertical bar "|" separates different variants of the item. Terms in square brackets are optional; parentheses group terms into one item; asterisk means that an item can occur zero or more times; capitalized words denote terminal symbols (that is basic symbols, not parsable into smaller parts.)

Example:

    module := MODULE_NAME ": {" [member] ("," member)* "}"
    member := (field | method)
    field := NAME ":" (type_constructor | value_initializer)

Source files

Transd program are defined in one or more source files. Source files should be in UTF-8 encoding. The program code in a source file should be placed after the Transd code marker:

#lang transd




Modules

The top syntax unit in Transd is a module. A Transd program consists of one or more modules. Module is an arbitrary block of grouped together functions and data variables, which are called module members. All module members within one module are visible and accessible to each other.

A source file can contain several modules. Conversely, a definition of a large module can be contained in several source files. Each module in the program should have a unique name.

The grammar of a module:

    module := MODULE_NAME ": {" [member] ("," member)* "}"
    member := NAME ":" declarator

Example:

MainModule : {
  s : "Hello, world!",
  _start : (lambda (textout s))
}

General syntax

All the code in a Transd program is organized into modules. Modules have a very simple structure: a module is, basically, a comma separated list of module members. The syntax of module members definition is simple as well: every member is defined in the form of a name/value pair:

Module1: {
  var1: 5,
  func1: (lambda (textout var1))
}

Module members are of two kinds: data members and function members, which are often called fields and methods respectively.




Variables

A variable in Transd is a named reference to an object in memory. When a variable is declared, it receives a type, and it can only refer to objects of that type.

By their lifetime variables in Transd are divided into two kinds:

  1. Module members (fields).
  2. Function local (scoped) variables.

Module fields

Declaration

Module fields are declared as a part of module definition:

The declaration of a field can in certain cases be used as a place for the field's initialization (that is for assigning a value to the field). These cases are limited to the following:

  1. Initializing the field with a literal value.
  2. Initializing the field with a special type constructor, which performs initialization without using references to other functions or variables outside of it.

The syntax for a module field declaration is as follows:

    field := NAME ":" (type_constructor | value_initializer)

Example:

Module1: {
  s:  String(),
  s1: String("some string"),
  v:  Vector<Int>( 10 ),
  v1: Vector<Int>( [1, 2, 3] )
}

In the example above, the s and s1 fields are declared as Strings and s1 is initialized with "some string" value. The v and v1 fields are declared as Vectors of integers. v is initialized with a special type constructor which fills it with 10 integers having the default (zero) value. v1 vector is filled with 3 integers, which have values 1, 2 and 3.

This example uses explicit type constructors for all four fields. When a type allows initializing with a literal value, and the field type can be inferred from the literal, then a short form of initialization can be used (called value initialization):

Example:

Module1: {
  s1: "some string", // 's1' becomes a String with "some string" value
  v1: [1, 2, 3]  // 'v' becomes a Vector<Int> filled with '1', '2', '3' integers.
}

Visibility and access

Module fields by default are only visible within the module in which the field is defined. For allowing access to a field from other modules, that field must be declared as public.

Life time

Local variables

Local variables in functions are introduced with the (with ...) construction. They are only visible inside that construction.

Example:

someFunc : (lambda (with a 1 b 2 (textout (+ a b)))) // outputs "3"




Forms

An expression is a piece of code which can be evaluated as a single whole and whose data value can be obtained. Expressions consist of expression members called constituents. All expressions in Transd are enclosed in parentheses and have a similar structure resembling a function call: the first constituent always names the operation performed by the expression, and the remaining constituents are parameters to that operation. Such parenthesized construction in Transd is called form. The first constituent of a form is called the form's subject. Forms can contain other forms as constituents.

Examples of forms:

(+ 1 1)
(== (+ 3 5) (* 2 4))
(computeDistance Point(2 3) Point(4 5))
(textout "five plus three equals" (+ 5 3))
(sqrt (+ (pow (- x1 x2) 2 ) (pow (- y1 y2) 2 ) )




Functions

Forms are syntactical constructs for function objects. For simplicity, we will refer as function to any object that can be invoked (called) with or without arguments, in order to obtain some value from that object or to have it to perform some action.

In Transd there are two kinds of function objects: a function definition and a function call. In source code the syntax for these objects looks similar, and for the purpose of distinguishing between the two, the function definition objects have as their first constituent the lambda keyword (for brevity, instead of this keyword, one can use the symbol 'λ' (Greek letter "lambda", Unicode symbol 955 (0x3BB)).

These two function definitions are equivalent:

func1: (lambda (textout "Hello, world!")),

func2: (λ (textout "Hello, world!"))

The second type of function object - a function call - is any form that doesn't contain the lambda keyword as the first participant. In the examples above, (textout "abc") is a function call. That is, the definition of the func1 function, consists of a single call to a built-in textout function with the string "Hello, world!" as a parameter. This function definition is equivalent to, for example, Python's:

def func1():
    print("Hello, world!")

There are two kinds of function calls in Transd: method calls and routine calls.

A method call is an invocation of a member function of some object:

(append vec1 25) // append an integer '25' to the end of 'vec1' vector object
(+ 5 7) // add 7 to 5

The first method call above invokes the append method of a built-in Vector type on the vec1 object of that type with passing 25 as an argument. The second one, invokes the + method of a built-in Int type on the 5 object of that type with passing 7 as an argument. This illustrates the syntactic rule: all method calls must have the object whose method is invoked as their first argument. This first argument in the context of the call is refered to as subject in Transd documentation.

A subject can be passed as an expression that returns an object whose method is invoked:

(+ (+ 2 3) 7) // add 7 to the result of (+ 2 3)

A routine call is an invocation of a function that is not a member of some class:

(textout "5 + 7 = " (+ 5 7)) // outputs: "5 + 7 = 12"
(textout 5 " plus " 7 " equals " (sqrt 144)) 
// outputs: "5 plus 7 equals 12"

Routines are not associated to some object and don't have a subject in their call syntax.




Classes

Classes are templates for creating objects. A template is a list of data variables, which represent some kind of things, for example a database record storing information about an employee:

class Employee : {
  id: Int(),
  name: String(),
  department: String(),
  salary: Int()
}

Along with the list of data variables classes usually contain a list of functions which know how to operate on that data. For example, a class representing a point on a geometrical plane might have a function for computing the distance to some other point:

class Point : {
  x: Double(),
  y: Double(),
  distance: (λ pt Point()
               (sqrt (+ (pow (- x pt.x) 2) (pow (- y pt.y) 2))))
}

As one can see, classes have the same syntax as modules: they both are lists of functions and variables. The difference between modules and classes is that modules exist strictly in single number: you cannot have a copy of a module. Whereas you can have as many different copies of an object of some class as you want. This is why classes are called templates. When you create a copy of a template, it is said that you instantiate the class, that is create an instance object of that class.

All instance objects of a class are independent from each other: when you change the values of data variables of some objects, this doesn't affect variables of other objects.

Classes, in fact, are types of objects, and are similar to built-in types such as String or Vector. You instantiate a class by declaring a variable of that class in the same way as you declare variables of built-in types:

i: Int(),
str: String(),
pt: Point(),
record: Employee()

Initialization of class objects

Classes can have an init method, which is automatically called when a class instance object is created. This method can receive arguments that can be used for setting the values of the object's fields.

class Point : {
  x: Double(),
  y: Double(),
  init: (λ x_ Double() y_ Double() (= x x_) (= y y_))
}

pt: Point( 2.71 3.14 )




Type system

Overview of Transd type system

Transd is strongly typed and its type system offers a variety of types to choose from for a particular programming task. Each type in Transd iѕ either basic or compound, and either simple or container. Within these categories Transd types are organized as follows:

                     Types
                    /     \
               Basic       Compound
              /     \       /      \
        Simple  Containers Simple  Containers

Basic types are: Bool, Byte, Char, Int, Long, ULong, Double, String, ByteArray.

Among basic types, String and ByteArray are containers, others - are simple types.

Compound types take an additional type parameter for their instantiation. For example, a vector of integers is declared as Vector<Int>. Such vector can only contain Ints, that is the "Int" type parameter becomes a part of the definition of the whole type. This is why such types are called "compound". Compound types are also refered to as generic types, or generics.

Compound types are: Position, Tuple, Vector, Index, HashIndex.

Position is a simple type, all other compound types are containers.

Type traits

Each type in Transd has a set of properies associated with it. These properties are called type traits. Type traits are used for organizing types into a hierarchy and grouping together similar types. Such grouping makes possible polymorphic use of types.

For example, types Double and Int both have the :Number property. If some function can accept both Double and Int as a parameter, then instead of writing two overloaded versions of the function, it's possible to use the :Number type property as the parameter type.

For example, a function receiving a number and returning the integral part of that number can be defined as follows:

#lang transd

MainModule: {
i: Int(5),
d: Double(5.5),
s: String("5"),

intgr: (λ n :Number() (ret (to-Int n))),

_start: (λ (lout (intgr i)) // => 5
           (lout (intgr d)) // => 5
           (lout (intgr s)) // compilation error!
)
}

Built-in types

Null

Null - is a special kind of type, which no object can have except of the special “null object”. This object may be used as a placeholder indicating absence of useful value, as the return type of functions that don't return any objects, for error signalling, etc.

Bool

Bool - the Bool type is used for storing logical truth values. The objects of this type can only have two values that are represented by keywords true and false.

Other types are implicitly convertible to Bool type. The simple types with value 0 and containers with zero length (empty) are converted to false, all other values are converted to true.

Byte

Byte - 8-bit unsigned integer.

Values range: 0 - 255

Type constructor:

Byte( :Integer )

Byte type has a polymorphic constructor, which accepts any integer as an initialization value, performing the automatic casting if needed.

Char

Char - a type that represents a Unicode character: a Unicode code point encoded in UTF-16/32.

Char is the only Transd type that has a platform-dependent size.

On Linux, Char is 4-byte wide and uses UTF-32 encoding. On Windows, Char is 2-byte wide and uses UTF-16LE encoding.

Integral numeric types

Integral numeric types represent integer numbers. Transd has the following integral numeric types: Byte, Int, Long, ULong.

Type       Values range                      Size         Signed
-------------------------------------------------------------------

Byte       0 to 255                          1 byte       unsigned

Int        -2,147,483,648 to                 4 bytes      signed
           2,147,483,647

Long       -9,223,372,036,854,775,808 to     8 bytes      signed
           9,223,372,036,854,775,807

ULong      0 to 18,446,744,073,709,551,615   8 bytes      unsigned

Double

Double - is double precision 64-bit IEEE 754 floating point type.

String

String - is a container type that represents text string: it stores a sequence of Unicode characters (code points). This type is optimized for manipulating text-like data. Apart from supporting generic container operations, String supports a set of methods specific to manipulating text strings.

Below is the list of the String class methods. subj in the parameter list is the String object on which the method is called.

String constructor

String( [str]* )
Parameters:
str - any object evaluating to String.

str can be a string variable, string literal or an expression returning a String. Any number of space separated objects can be passed to the constructor. The new string is the concatenation of all arguments. If no arguments is given, the new string is empty string.

Examples:

str1 : String(),
str2 : String("Hello!")

Value initializer

A String variable can be initialized with a string literal.

Example:

str3 : "Hello!"

String methods

Methods of String class include:

String container methods
clear
(clear subj)

Return type: Null

Discards the string's contents and makes it empty.

eq
(eq subj str)
 or
(== subj str)

Parameters:
str : String
Return type: Bool

Compares two strings: subj and str. Returns true if code point sequences in both strings are identical. Otherwise, returns false.

set
(set subj str)
 or
(= subj str)

Parameters:
str : String
Return type: Null

Assigns the value str to subj.

size
(size subj)

Return type: Int

Returns the length of the string as the number of code points.

String sequence container methods
back
(back subj)

Return type: Char

Returns the last character of non-empty subj. If subj is empty, an exception will be thrown.

begin
(begin subj)

Return type: Position

Returns a Position object for the first character of subj. If subj is empty, the function returns the end position.

coincide
(coincide subj other)

Parameters:
other : String - string.
Return type: Int

Returns the number of characters from the beginning that are identical in both strings. That is, the length of the prefix, if any, that is common to both strings. A backward Range as one or both of the parameters causes the function to compare characters from the end of that parameter:

(coincide "abcpqrs" Range(in: "wxyzcba" -0 0)) // returns: 3
end
(end subj)

Return type: Position

Returns a Position object denoting the end of subj's character sequence. The end position is the position just after the last character. In an empty string the begin position is equal to the end position.

front
(front subj)

Return type: Char

Returns the first character of non-empty subj. If subj is empty, an exception will be thrown.

reverse
(reverse subj)

Return type: String

Reverses the character order in subj. That is "abc" is transformed to "cba". The function returns the reference to the transformed subj.

shuffle
(shuffle subj)

Return type: String

Randomly permutates the characters in subj and returns the reference to it.

sort
(sort subj [cmpFunc])

Parameters:
cmpFunc : Lambda - (optional) comparison predicate function.
Return type: String

Sorts a string. That is, arranges the string's code points in ascending or descending order according to some comparison function. The default comparison function compares the numeric values of code points. The reversed sorting order is achieved by using a reversed Range as the function's subject:

s: "bcaed",
f: (λ (lout (sort Range(in: s -0 0)))) // "edcba"
String specific methods
find-first-not-of
(find-first-not-of subj str [pos])

Parameters:
str : String - a list of characters.
pos : :Integer - (default: 0) character index in subj to start search from.
Return type: Int

Returns the index of the first character in subj, not contained in str. If no such character was found, the returned value is -1.

match
(match subj patt)

Parameters:
patt : String - a regular expression to match.

Matches the subj to the regular expression pattern patt. Returns true if subj matches the pattern, otherwise, returns false. The regular expression should be in ECMAScript grammar.

read
(read subj)

Reads a string from StdIn to subj.

starts-with
(starts-with subj str)

Parameters:
str : String - string.
Return type: Bool

Returns true if subj contains str as a substring starting from the first character. Otherwise, returns false.

strip
(strip subj str)
 or
(strip subj str1 str2)

Parameters:
str, str1, str2 : String
Return type: Null

Removes from the ends of subj the characters specified in str. The first form removes from both ends the characters in str. The second form removes from the left end the characters in str1, from the right end - the characters in str2. If no str is passed, the default behaviour is to remove from both ends whitespace characters: , '\r', '\n', '\t'.

subn
(subn subj start [count])

Parameters:
start : Int - start position of substring;
count : Int - (default: 1) count of characters to include to substring. Return type: String

Retuns a copy of substring of subj starting from start position and having count length.

tolower
(tolower subj)

Converts all letters in the string to lower case.

toupper
(toupper subj)

Converts all letters in the string to upper case.

String examples

read

(with s String()
  (read s) (textout "The input was:" s))

set, eq

(with s "" s1 "" s2 "abcd"
   (set s "abcd") (= s1 s2) (lout (eq s s1) (== s s2)))
// Output: true true

ByteArray

ByteArray is a sequence container type specialized for storing 8-bit unsigned integers. This container operates on the same underlying values as Vector<Byte>, but ByteArray uses raw memory bytes as its elements, and is considerably faster and uses less memory than Vector<Byte>. Such operations as reading and writing from/to files use ByteArray as the container for file contents' bytes.

ByteArray constructors

1. ByteArray()
2. ByteArray( size )
3. ByteArray( <value_initializer> )
Parameters:
size : Int - the initial size of the array;
value_initializer - a list of values to put into the array.

1 - creates an empty array;
2 - creates an array of the specified size, filled with elements whose value is 0;
3 - creates an array filled with the specified elements. <value_initializer> parameter is a comma separated, square bracket enclosed list of integers with values from 0 to 255 inclusively:

value_initializer ::= "[" [n,]* n "]"

Examples:

arr1 : ByteArray(),
arr2 : ByteArray( 5 ),
arr3 : ByteArray( [1,2,3,4,5] ) 

ByteArray methods

Methods of ByteArray class include:

ByteArray container methods
clear
(clear subj)

Return type: Null

Erases all elements of an array and makes it empty.

eq
(eq subj other)
 or
(== subj other)

Parameters:
other : ByteArray
Return type: Bool

Compares two arrays: subj and other. Returns true if all elements and their order in both arrays are identical. Otherwise, returns false.

set
(set subj other)
 or
(= subj other)

Parameters:
other : ByteArray
Return type: Null

Copies all elements of other to subj.

size
(size subj)

Return type: Int

Returns the number of elements in the array.

Sequence container methods
back
(back subj)

Return type: Byte

Returns the last element of non-empty subj. If subj is empty, an exception will be thrown.

begin
(begin subj)

Return type: Position

Returns a Position object for the first element of subj. If subj is empty, the function returns the end position.

end
(end subj)

Return type: Position

Returns a Position object denoting the end of subj's byte sequence. The end position is the position just after the last element. In an empty string the begin position is equal to the end position.

front
(front subj)

Return type: Byte

Returns the first element of non-empty subj. If subj is empty, an exception will be thrown.

reverse
(reverse subj)

Return type: ByteArray

Reverses the element order in subj. That is, an array '[1,2,3]' is transformed to '[3,2,1]'. The function returns the reference to the transformed subj.

shuffle
(shuffle subj)

Return type: ByteArray

Randomly permutates the characters in subj and returns the reference to it.

sort
(sort subj [cmpFunc])

Parameters:
cmpFunc : Lambda - (optional) comparison predicate function.
Return type: ByteArray

Sorts a byte array. That is, arranges the array's elements in ascending or descending order according to some comparison function. The default comparison function compares the numeric values of byte elements. The reversed sorting order is achieved by using a reversed Range as the function's subject:

arr: ByteArray([2,15,9,11,4]),
f: (λ (lout (sort Range(in: arr -0 0)))) // [15,11,9,4,2]

Vector

Vector is a container in which elements are stored as a linear sequence. Unlike ByteArray and String containers, which are specialized to store only a single type of elements - bytes and chars respectively, - Vector containers can store various types: integers, strings, objects of custom types, etc., which is why Vector in Transd is termed as a generic container.

Vectors in Transd are strongly typed: all elements in a vector must be of one and the same type. The type of elements which are to be stored in the vector is specified in the vector declaration statement within angle brackets:

vec1: Vector<Int>() // Vector of Int's
vec2: Vector<Record>() // Vector of objects a custom 'Record' class
vec3: Vector<Tuple<String Int>>() // Vector of 'Tuple<String Int>' tuples

Vector constructors

1. Vector<TYPE>()
2. Vector<TYPE>( size )
3. Vector<TYPE>( <value_initializer> )
Parameters:
TYPE - the type of elements which will be stored in the vector;
size:Int - the initial size of the vector;
value_initializer - a list of values to put into the array.

1 - creates an empty vector;
2 - creates a vector of the specified size, filled with default valued elements;
3 - creates a vector filled with the specified elements. <value_initializer> parameter is a comma separated, square bracket enclosed list of value initializers of vector elements (if their type permits the value initialization).

Examples:

vec1: Vector<Double>(),
vec2: Vector<Byte>( 100 ),
vec3: Vector<Int>([-2, 4, -15, 26]),
vec4: Vector<String>(["one", "two", "three"]),
vec5: Vector<Tuple<String Int>>([[["one", 1]], [["two", 2]], [["three", 3]]])

Value initializer

A Vector object can be created using a value initializer, inferring the element type automatically.

Example:

fruits: ["pear", "water melon", "apple"] // creates Vector<String>

Vector methods

Methods of Vector class include:

Vector container methods
clear
(clear subj)

Return type: Null

Discards the vector's contents and makes it empty.

eq
(eq subj other)
 or
(== subj other)

Parameters:
other : Vector<TYPE>
Return type: Bool

Compares two vectors: subj and other. Returns true if all elements and their order in both vectors are identical. Otherwise, returns false.

set
(set subj other)
 or
(= subj other)

Parameters:
other : Vector<TYPE>
Return type: Null

Clears the contents of subj and copies into it all elements of other.

size
(size subj)

Return type: Int

Returns the number of elements in subj.

Sequence container methods
back
(back subj)

Return type: TYPE

Returns the reference to the last element of subj.
subj must non-empty, or exception will be thrown.

begin
(begin subj)

Return type: Position

Returns the Position object for the first element of subj. If subj is empty, the function returns end position.

end
(end subj)

Return type: Position

Returns the Position object pointing to the end of subj's element sequence. The end position is the position after the last element. In an empty vector the begin position is equal to the end position.

front
(front subj)

Return type: TYPE

Returns the first element of subj. If subj is empty, an exception will be thrown.

max-element
(max-element subj [cmpFunc])
reverse
(reverse subj)

Return type: Vector<TYPE>

Reverses subj's element sequence. That is, "[1,2,3]" is transformed to "[3,2,1]". Returns the reference to the reversed subj.

shuffle
(shuffle subj)

Return type: Vector<TYPE>

Randomly permutates the characters in subj and returns the reference to it.

sort
(sort subj [cmpFunc])

Parameters:
cmpFunc : Lambda - (optional) comparison predicate function.
Return type: Vector<TYPE>

Sorts a vector. That is, arranges the vector's element sequence in ascending or descending order according to some comparison function. By default, the comparison of elements is done with the "less than" predicate. The reversed sorting order is achieved by using a reversed Range as the function's subject:

v: [2,0,3,1],
f: (λ (lout (sort Range(in: v -0 0)))) // [3, 2, 1, 0]

Streams

A stream is an object that can function as a generalized input/output (I/O) channel. Abstract class Stream implements this generalized IO channel. ٰConcrete stream classes inherit the Stream class and support a common interface for reading or outputting data to and from various sources/destinations in a uniform way.

Transd defines five stream classes:

Streams are used for reading/writing files, outputting text to the screen, for buffered I/O, etc.

Examples

Text output

(textout to: StdOut "Hello!") // print to StdOut stream
(textout "Hello!") // same as above, StdOut is the default stream for '(textout)'
(with fs FileStream() (open fs "C:/Temp/hello.txt" "w")
    (textout to: fs "Hello!")) // write text to a file

Text input

(with str1 String() fs FileStream()
    (textin from: StdIn str1) // read from StdIn to str1
    (textin str1) // same as above, StdIn is the default stream for '(textin)'
    (open  "D:\\data\\datafile.txt")
    (textin from: fs str1) // read text from a file
)

Buffered output

StringStream

ByteStream

FileStream

Built-in functions

textout
(textout [to: <streamObj>] [param] ...)

Parameters:
streamObj : Stream - (default: StdOut) a Stream object.
param - a variable, literal or expression.

Return type: Null

Prints out the parameters [param]* to a stream destination: streamObj. The destination can be of type StringStream, ByteStream, or FileStream. If the destination is not specified, the output is done to StdOut.

[param] ... is a list of any number of space separated parameters. A parameter is any expression whose value can be represented by a text string. 'Null' values are represented by a null string and not printed.

Examples:

(with s "abcde"
    (textout (front s) (back s) (clear s) " "
         (eval "(front s)") " " (eval "(back s)"))
)
// Output: ae false false

(with s "abcde" n 10
    (textout "The length of \"" s "\" is " 
        (if (> (size s) n) "more" else "less") " than " n " characters")
)
// Output: The length of "abcde" is less than 10 characters.

Built-in classes

Directory

Methods

read
(read subj dir filePatt)

Parameters:
dir : String - the directory whose contents are to be read;
filePatt : String - the regular expression with the pattern of file names to include.
Return type: Null

Reads the contents of a directory dir by enumerating file and directory names, contained in it, and storing them in the internal list. After that, file and directory names can be retrieved with the methods (files) and (dirs) respectively.

read-rec
(read-rec subj rootDir filePatt)

Parameters:
rootDir : String - the directory whose contents are to be read;
filePatt: String - the regular expression with the pattern of file names to include.
Return type: Null

Recursively reads file and directory names in a directory tree. After that, file and directory names can be retrieved with the methods (files) and (dirs) respectively.

TSDBase

Filter




Container functions

Container functions are functions that operate on more than one container class. That is, they are not specific to some particular container class, but can be applyed to various container types (Vector, String, etc.) and they will produce similar results.

clear

(clear subj)
````
Return type: `Null`

Erases all elements from a container and sets its size to zero.

### max-element

(max-element ) ```

size

``scheme (size subj) ```` Return type:Int`

Returns the number of elements in a container.