[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Standards

ECL supports all Common-Lisp [see section Steele:84]. This chapter simply complements Chapter 2 of [see section Steele:84], by describing implementation dependent features of Common-Lisp in Chapter 2 of [see section Steele:84], with the same section title.

2.1 Numbers  
2.2 Characters  
2.3 Symbols  
2.4 List and Conses  
2.5 Arrays  
2.6 Hash Tables  
2.7 Readtables  
2.8 Packages  
2.9 Pathnames  
2.10 Streams  
2.11 Random-States  
2.12 Structures  
2.13 Functions  
2.14 Unreadable Data Objects  
2.15 Overlap types  
2.16 ANSI-CL compliance  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Numbers

2.1.1 Integers  
2.1.2 Ratios  
2.1.3 Floating-Point Numbers  
2.1.4 Complex Numbers  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.1 Integers

Fixnum@c's in ECL are those integers in the range (-2^29) to (2^29-1), inclusive. They are represented as immediate data, so no memory allocation is involved when using fixnum's. Other integers are bignums. Thus 25 factorial (25!)

 
15511210043330985984000000

is definitely a bignum in ECL.

Common-Lisp in ECL.

 
most-positive-fixnum = 536870911 = 2^29-1
most-negative-fixnum = -536870912 = - 2^29
boole-1 = 3
boole-2 = 5
boole-and = 1
boole-andc1 = 4
boole-andc2 = 2
boole-c1 = 12
boole-c2 = 10
boole-clr = 0
boole-eqv = 9
boole-ior = 7
boole-nand = 14
boole-nor = 8
boole-orc1 = 13
boole-orc2 = 11
boole-set = 15
boole-xor = 6

See Chapter 12 of [see section Steele:84] for their meanings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.2 Ratios

There are no implementation-dependent features for ratios.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.3 Floating-Point Numbers

ECL supports two floating point formats: single-float double-float@c. These are implemented with IEEE single and double float arithmetic, respectively. short-float is a synonym for single-float, and long-float is a synonym for double-float. The initial value of read-default-float-format is single-float.

Both single-float and double-float are represented with a pointer descriptor, so float operations can cause number consing. Number consing is greatly reduced if type declarations are supplied in programs.

An expression such as (eql 1.0s0 1.0d0) is false, but (eql 1.0f0 1.0d0) is true. Similarly, (typep 1.0l0 'short-float) is false, but (typep 1.0l0 'double-float) is true. For output purposes all floating-point numbers are assumed to be of single or double format.

The floating-point precisions and exponent sizes are:

 
Format    precision exponent    
---------------------------- 
Short      24 bits    8 bits
Single     24 bits    8 bits
Double     53 bits   11 bits
Long       53 bits   11 bits

There is no "minus zero." (eql 0.0 -0.0) is true.

Common-Lisp in ECL.
 
most-positive-short-float
  = most-positive-single-float
  = - most-negative-short-float
  = - most-negative-single-float
  = 3.402823s38

least-positive-short-float
  = least-positive-single-float
  = - least-negative-short-float
  = - least-negative-single-float
  = 1.401298s-45

most-positive-long-float
  = most-positive-double-float
  = - most-negative-long-float
  = - most-negative-double-float
  = 1.797693134862315f308

least-positive-long-float
  = least-positive-double-float
  = - least-negative-long-float
  = - least-negative-double-float
  = 4.940656458412469f-324

short-float-epsilon
  = 2.980232s-8

short-float-negative-epsilon
  = 2.980232s-8

long-float-epsilon
  = double-float-epsilon
  = single-float-epsilon
  = 5.5511151231257827f-17

long-float-negative-epsilon
  = double-float-negative-epsilon
  = single-float-negative-epsilon
  = 5.5511151231257827f-17

pi = 3.141592653589793

See Chapter 12 of [see section Steele:84] for their meanings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1.4 Complex Numbers

There are no implementation-dependent features for complex numbers.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Characters

ECL is fully ANSI Common-Lisp data type, with the following peculiarities.

2.2.1 Character types  
2.2.2 Standard Characters  
2.2.3 Line Divisions  
2.2.4 Non-standard Characters  
2.2.5 Character Attributes  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.1 Character types

In ECL the extended-character is empty, and all characters are implemented using 8-bit codes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.2 Standard Characters

ECL supports all standard and semi-standard characters listed in Section 2.2.1 of [see section Steele:84]. Non-printing characters have the following character codes.
 
Character        Code  (in octal)
--------------------------------
#@cNull                  000
#@cSpace                 040
#@cNewline               012
#@cBackspace             010
#@cTab                   011
#@cLinefeed              012
#@cPage                  014
#@cReturn                015
#@cRubout                177

Note that #@cLinefeed is synonymous with #@cNewline and thus is a member of standard-char. Other semi-standard characters are not members of standard-char.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.3 Line Divisions

Since ECL represents the #@cNewline character by a single code 12, problems with line divisions discussed in Section 2.2.2 of the [see section Steele:84] are absent in ECL.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.4 Non-standard Characters

ECL supports no additional non-standard characters.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.5 Character Attributes

Characters in ECL have no attributes, and thus it lacks the functions and variables #'char-bits, #'char-font, char-bits-limit, etc, defined in Chapter 13 of [see section Steele:84].


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Symbols

The print name of a symbol may consist of up to 16777216 (i.e., the value of array-total-size-limit) characters. However, when a symbol is read, the number of characters (not counting escape characters) in the print name is limited to 2048.

It is not recommended to write on the strings which have been passed to #'make-symbol or returned from #'symbol-name.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.4 List and Conses

There are no implementation-dependent features for lists and conses.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5 Arrays

ECL arrays can have up to 64 ranks.

When the value of the Common-Lisp 22.1.6 of [see section Steele:84]) is ()@c, then bit-vectors are printed as #<a bit-vector address>, other vectors are printed as #<a vector address>, and other arrays are printed as #<an array address>. The default value for *print-array* is ()@c.

Common-Lisp

 
    array-dimension-limit = 16777216
    array-rank-limit = 64
    array-total-size-limit = 16777216

See Section 17.1 of [see section Steele:84] for their meanings.

2.5.1 Vectors  
2.5.2 Strings  
2.5.3 Bit-Vectors  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5.1 Vectors

In ECL, array elements are represented in one of six ways depending on the type of the array.

 
Array Type                               Element Representation
---------------------------------------------------------------
(array t) and (vector t)                      a cell pointer
(array fixnum) and (vector fixnum)            32 bit signed integer
(array string-char) and string                8 bit code
(array short-float) and (vector short-float)  32 bit floating point
(array long-float) and (vector long-float)    64 bit floating point
(array bit) and bit-vector                    1 bit bit


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5.2 Strings

The ECL implementation of strings is ANSI Common-Lisp 'base-string, 'simple-string and 'simple-base-string are defined, but due to the lack of extended characters 'base-string and 'simple-base-string are simple aliases of 'string and 'simple-string.

A string may consists of up to 16777216 (i.e., the value of array-total-size-limit) characters. However, when a string is read, the number of characters in it (not counting escape characters) is limited to 2048.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5.3 Bit-Vectors

There are no implementation-dependent features for bit-vectors.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.6 Hash Tables

All hash tables are printed as #<a hash-table address>.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.7 Readtables

All readtables are printed as #<a readtable address>.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.8 Packages

The following packages are built into ECL.

Name Nicknames
common-lisp cl, lisp
common-lisp-user cl-user, user
system si
keyword

For instance, the system package has two nicknames sys and si; system:symbol may be written as sys:symbol or si:symbol.

Depending on the configuration option by which ECL has been built, additional packages may be available:
 
compiler clos xlib

The compiler package contains symbols used by the ECL compiler. Other packages are described in Section 11.6 of [see section Steele:84]. The clos package is used for the internal symbols of the Common-Lisp System, which is described in Chapter 14. The xlib package is used for the internal symbols of CLX, the Common-Lisp System, which is described in a separate manual.

Packages are printed as #<package-name package>.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.9 Pathnames

ECL provides a # macro #P" that reads a pathname: #P"string" is equivalent to (pathname "string"). For example, #P"foo.lsp" is equivalent to (pathname "foo.lsp"). The same format is used when a pathname is printed.

The initial value of the Common-Lisp *default-pathname-defaults* is #P"" (or, equivalently, (pathname "")).

A pathname in the file system of Common-Lisp host, device, directory, name, type and version.

Let me briefly explain how ECL converts a namestring into a pathname. First ECL tries parsing the namestring using the logical pathnames syntax, which is as follows
 
        [hostname:][;][directory-item;]*[name][.type[.version]]
        hostname = word
        directory-item = wildcard-word
	type, name = wildcard-word without dots
	version = NEWEST, newest or a number
Here, word is a sequence of one or more characters excluding the #\Null character and the asterisk `*'. And wildcard-word is a sequence of any character excluding #\Null and consecutive asterisks (i.e. "**" is not allowed).

If hostname is not found or it is not a logical hostname, then ECL tries the physical pathname syntax,
 
        [device:][[//hostname]/][directory-item/]*[name][.type]
        device, hostname = word
        directory-item, type = wildcard-word
	name = a wildcard-word with maybe a single leading dot
If this syntax also fails, then the namestring is not a valid pathname string.

It is important to remark that in ECL, all physical namestrings result into pathnames with a version equal to :NEWEST. Pathnames which are not logical and have any other version (i. e. NIL or a number), cannot be printed readably, but can produce a valid namestring which results of ignoring the version.

The following rules apply to both physical and logical namestrings. First, if a namestring contains one or more periods `.', the last period separates the namestring into the file name and the filetype.

 
     "foo.lsp"
         name:          "foo" 
         type:          "lsp"

     "a.b.c" 
         name:          "a.b" 
         type:          "c" 

If a namestring ends with a period, the filetype becomes the null string.
 
     "foo." 
          name:          "foo" 
          type:          ""  (null string)

If a namestring begins with a period, the file name becomes ()@c.
 
     ".lsp" 
          name:          nil 
          type:          "lsp" 

If a namestring contains no period, the filetype is ()@c.
 
    "foo" 
          name:          "foo" 
          type:          nil 

In a pathname, the file directory is represented as a list which always begins with either :relative or :absolute
 
     "common/demo/foo.lsp" 
     ";common;demo;foo.lsp" 
          directory:     (:relative "common"   "demo") 
          name:          "foo" 
          type:          "lsp" 
     "/common/demo/foo.lsp" 
     "common;demo;foo.lsp" 
          directory:     (:absolute "common"   "demo") 
          name:          "foo" 
          type:          "lsp"

If a namestring does not contain a directory, the directory component of the pathname is ()@c.
 
     "foo.lsp" 
          directory:     nil 
          name:          "foo" 
          type:          "lsp" 

The abbreviation symbols `.' and `..' may be used in a namestring, but only the second one is translated to a standard keyword
 
     "./demo/queen.lsp" 
          directory:     (:relative "." "demo") 
          name:          "queen" 
          type:          "lsp" 

     "../../demo/queen.lsp" 
          directory:     (:relative :up
          name:          "queen" 
          type:          "lsp" 

The part of a namestring after the last directory separator (`/' or `;') is always regarded as representing the file name and the filetype. In order to represent a pathname with both the name and the filetype ()@c, end the pathname with a slash.
 
     "/usr/common/" 
          directory:     (:absolute "usr" "common") 
          name:          nil 
          type:          nil 

     "/usr/common/.lsp" 
          directory:     (:absolute "usr" "common") 
          name:          ".lsp"
          type:          nil

`*' in the place of file name or filetype becomes :wild
 
     "*.lsp" 
          name:          :wild
          type:          "lsp" 

     "foo.*" 
          name:          "foo" 
          type:          :wild 


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.10 Streams

Streams are printed in the following formats.

#<input stream file-name>
An input stream from the file file-name.

#<output stream file-name>
An output stream to the file file-name.

#<string-input stream from string>
An input stream generated by (make-string-input-stream string ).

#<a string-output stream>
An output stream generated by the function make-string-output-stream.

#<a two-way stream>
A stream generated by the function make-two-way-stream.

#<an echo stream>
A bidirectional stream generated by the function make-echo-stream.

#<synonym stream to symbol>
The stream generated by (make-synonym-stream symbol ).

#<a concatenated stream>
An input stream generated by the function make-concatenated-stream.

#<a broadcast stream>
An output stream generated by the function make-broadcast-stream.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.11 Random-States

ECL provides a # macro `#$' that reads a random state. #$integer is equivalent to (make-random-state integer). The same format is used when a random state is printed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.12 Structures

There are no implementation-dependent features for structures.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.13 Functions

All functions in ECL are either compiled into bytecodes to be interpreted, or they are translated into C and then compiled using a native C compiler. Interpreted functions are printed using the formats
 
#<interpreted-function name>
#<interpreted-function address>
Compiled functions (including compiled macro-expansion functions) are printed in the following formats.
 
#<compiled-function name>
#<compiled-closure nil>

The output of (symbol-function fun) is a list, is either a function object if 'fun is has a function definition, (macro . function-object) if 'fun is a macro, and 'special if 'fun is a special form.

ECL usually drops the source code of a function unless the global variable si:*keep-definitions* was true when the function was translated into bytecodes. Therefore, if you wish to use #'compile and #'disassemble on defined functions, you should issue (setq si:*keep-definitions* t) at the beginning of your session.

Common-Lisp

 
call-arguments-limit = 64
lambda-list-keywords = (&optional
                        &aux
lambda-parameters-limit = 64
multiple-values-limit = 32

Refer to [see section Steele:84] for their meanings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.14 Unreadable Data Objects

There are no implementation-dependent features for unreadable data objects.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.15 Overlap types

In ECL, the types number and array are certainly subtypes of common, since ECL does not extend the set of objects of these types.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.16 ANSI-CL compliance

In this section we have documented the how much ECL implements of each section in [see section ANSI], and which are the most important implementation-dependent features.

5. Data and control flow

10. Symbols:

11. Packages:

12. Numbers:

13. Characters: complete

14. Conses:

16. Strings: complete

19. Filenames: complete, but simplistic

20. Files:


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Juan Jose Garcia Ripoll on May, 30 2005 using texi2html