EMA-XPS Online



The hybrid shell babylon3 offers only a subset of the 
power of CommonLISP to the knowledge engineer. Under
EMA-XPS all CommonLISP constructs may be used. But take
care of the emulations! 
Especially the use of arrays should be avoided, not to 
run into conflict with babylon3 SETs.

Following is the *allowed* set of BabylonLISP con-
structs, which may sometimes be different to the
CommonLISP syntax!

The organisation of this capter is close to   
chapter 9 of the babylon3 documentation.

The rest of this page focusses on the miscelaneous
data types available with babylon LISP:


There are four different kinds of numbers in
Common Lisp: Integers, ratios, floating-point
numbers and complex numbers.


syntax: <sign><digits>

The integers may have a sign and they normally have
a base of 10. This base can be in the range from 2 to
36, too.

syntax: #<base>R<sign><digits>

There are special notations for binary, octal and
hexadecimal bases:

syntax: #B<sign><digits>

examples:       3
               #2R1011	; decimal 11, base 2.
               #B-1011 ; decimal -11, binary base.
               #O325   ; decimal 213, octal base.
               #XD4    ; decimal 212, hexad. base.


syntax: <sign><digits>/<digits>

Ratios can consist of two integers.
They may have a sign too. The denominator of a ratio
may not be zero and if the ratio is not shortened, it
will be converted internally into a shortened form.
A different base can also be used, but in this case
the base number is for the numerator and the denomi-

syntax:     #<base>R<sign><digits>/<digits>

examples:       3/2

               >(/ 4 6)
               2/3	; internally converted!

               #B11/10	; decimal 3/2, binary base.


syntax: <sign><digits>.<digits><format><sign><exp.>

Floating-point numbers may have a sign and they can be
written as decimal ratios or in an exponentiell form.
Floating-point numbers can be used with different pre-
cisions, depending on the implementation. The letters
e, s, f, d und l specify the format.

e: format isn't specified
s: short-format:
      (min. precision 13 bits, min. exp. 5 bits)
f: single-format:
      (min. precision 24 bits, min. exp. 8 bits)
d: double-format:
      (min. precision 50 bits, min. exp. 8 bits)
l: long-format:
      (min. precision 50 bits, min. exp. 8 bits)

examples:       0.0      ; zero in default format
                0E0      ; also zero in default format
                      ; pi in default format
                      ; pi in short format
                      ; pi in single format
                      ; pi in double format
                      ; pi in long format


syntax: #C(<real part> <imaginary part>)

Complex numbers are represented in cartesian form,
with a real part and an imaginary part each of which
is a non-complex number. They will be converted
internally, if they are of a different type.

examples:      #C(3.0s1 1.5s-1)
               #C(1 -2)
               #C(2/3 2.0)     ; will be converted 
               #C(0 1)            internally to
                                   #C(0.6666667 2.0)


Syntax: #\<character>

In Common Lisp you can use all ASCII-codes (0 - 255)
as a character. Characters return theirselves.
Characters with the same ASCII-Codes are EQ most of
the time (Depends on the implementation).

example:       >#\A


Syntax: "<string>"

Strings are special vectors, which elements are
characters. Stringoperations only work on the active
part of a string. Strings are enclosed in "".

example:       >"hallo"

EMA-XPS Online