Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
550 lines (533 sloc) 25.5 KB



EuLisp Definition

Update EuLisp definition and Youtoo and EuXLisp implementations

to correspond to the EuLisp-1.0 proposals. See proposal document.

Undefined references [34/41]

  • [X] class:abstract-class
  • [X] class:character-sequence
  • [X] class:collection
  • [X] class:condition-class
  • [X] class:<function>
  • [-] class:function-class
  • [-] class:hash-table
  • [X] class:list
  • [X] class:metaclass
  • [-] class:method
  • [X] class:name
  • [X] class:sequence
  • [-] class:simple-class
  • [-] class:simple-function
  • [-] class:simple-method
  • [-] class:simple-thread
  • [X] class:super-class
  • [X] condition:condition
  • [X] condition:no-converter
  • [X] condition:methods-exists
  • [X] condition:read-error
  • [X] defform:defmacro
  • [X] defform:defun
  • [X] function:eq
  • [X] function:eql
  • [X] function:end-of-stream
  • [X] function:fill-buffer
  • [X] function:=
  • [X] generic:binary<
  • [X] generic:binary=
  • [X] generic:eql
  • [X] generic:eq|
  • [X] generic:equal
  • [X] generic:generic-prin
  • [X] generic:method
  • [X] generic:mod
  • [X] generic:read
  • [X] keyword:accessor
  • [X] keyword:export
  • [X] setter:method-function
  • [X] syntax:unquote-splice

Add entry for the <method> class in Level-1

Add details of the <hash-table> class and functions

Update stream module

to corresponding to the Youtoo implementation.

Add descriptions of constants to “Layout and Typography”

in structure.tex. Include details of constant instances of classes and constant bindings to classes (class aliases).

<thread> vs <abstract-thread>

Sort out the difference between the EuLisp definition and the Youtoo implementation with respect to the name of the abstract base-class for threads. In the definition it is <thread> whereas in Youtoo it is <abstract-thread> and <thread> is used for the currently used thread type.

Reformat the defgeneric rewrite rules to conform to the others

Consider reformatting all of the rewrite rules

to be more consistent with the syntax description.

Add the return type to the syntax descriptions

Add “signatures” to all function descriptions

Change macro definitions to special operators

It doesn’t seem sensible to effectively specify that certain syntax MUST be implemented as macros; surely this decision should be taken by the implementers and for efficiency reasons it might be preferable that more of the special operators are implemented as primitives of the language.

Finish the “Lexical Syntax” section

Provide a bit more background information.

Introduce the “Special Forms” list in modules.tex

Or move this list to a more appropriate place, e.g. at the beginning of the section concerning “special forms”.

Introduce the “Level-1” library and describe “module-1”

Re-reference definitions in the “Level-1” library

so that they do not clash with those in the “Level-0” library.

Remove the “syntax-category” entries from the index

Add slice generic function and methods

Add destructive <sequence> generic functions sort! and reverse!

Check for other <sequence> methods which should destructive variants.

Clarify the wording concerning the relationship between nil and ()

State that (eq ‘nil ‘()) ==> t.

Replace equal with binary=

Remove the equal generic function and methods and introduce a complete set of binary= methods.

Change naming convention for predicates? and destructive! functions

There is a suggestion in the definition documents suggesting that the Scheme/T naming convention for predicates (end in ?) and destructive functions (end in !) should be considered for EuLisp. I agree with this suggestion to improve consistency and readability and made the corresponding changes including “null” -> “null?” and “atom” -> “atom?”.

Add a Scheme-style case statement

Add a Scheme-style else

for the default clause of cond and case forms. else is simply an alias for t.

Add when and unless conditional expressions

Add while loop construct

Rename labels -> letfuns

Consider including append

either in generic form or just for lists and perhaps strings.

Add support for Level-0 style super-class specification

If only one super-class is specified allow single-inheritance syntax of specifying the class directly rather than as a list.

Youtoo and EuXLisp

Replace equal with binary=

Remove the equal generic function and methods and introduce a complete set of binary= methods. The only difference between the definition of equal and binary= is the latter applies type coercion whereas equal was defined not two. If this property is an important feature equal could be reinstated as a function wrapper around binary= which does a type-consistency check.

Complete the renaming of predicates? and destructive! functions

All predicates ending in “-p” have been transformed and the functions “null?” and “atom?” added but the predicates ending in “p” have yet to be updated.

Change prin, print and write to be n-ary

Add sprin, sprint and swrite to take the stream as the first argument.

Add sprint and change print to use stdout

Rename require predicate keyword requiredp: -> required?:

Rename abstractp: -> abstract?:

Add slice method for <vector>

Reconsider <int>, should it be <fpi>?


What should <double-float> be called? <double-float>

<double> as in Youtoo? If so then the name <float> as the abstract base class is odd.


Split of word-length dependent functionality into separate modules

Split files
  • Comptime2/64bit/cg-exec.em
  • Comptime2/32bit/cg-exec.em


  • Comptime2/cg-exec.em
  • Comptime2/64bit/cg-exec-nbit.em
  • Comptime2/32bit/cg-exec-nbit.em

Regenerate all the .c files from the .em files to remove


Regenerate all the .c files from the .em files to remove eul_const

Remove compat.h

when backward compatibility is no longer needed.

Change all the Makefiles of all the Modules and Examples

so that the libraries and executables are located in platform/$(ARCH) or //Lib.$(ARCH)/ and //Bin.$(ARCH)/ directories.

Investigate warning messages from Examples/Misc/ffi2.c

Creating stand-alone application of module ffi2 … Compiling ffi2.c using gcc … //home/dm2/henry/EuLisp/youtoo/Examples/Misc/ffi2.c/: In function ‘ff_stub_ext_foo_in

Resolve warning messages from ffi applications

by introducing an option to allow a header file declaring the ff’s to be included in the stubs files.

Add header-files including the ffi definitions to all the Modules libraries.

Investigate when Lib.${ARCH}/*.i should be copied to Lib

Sort out the Modules/Bignum/Makefile

Currently the linking of the gmp library is hard-coded.

Upgrade the TclTk library to 8.5

Investigate problems with the Modules/OS (object serialisation) lib

Change the MPI interface to work with OpenMPI

Comptime2/youtoo.em sometimes ends-up in the wrong state

should be
(defmodule youtoo
;; Final, proper executable!
(import (level-1 math eval i-aux0 syntax-1))

(main *argv*)

)  ; end of module

but sometimes remains in the intermediate build state

(defmodule youtoo
;; Preliminary executable!
(import (level1 math eval))

(main *argv*)

)  ; end of module

during the boot-strap build. The consequence is that the final executable is unable to compile module files correctly issuing errors like

*** ERROR [nuseq][top-level]: exported lexical binding subseq not available
*** ERROR [nuseq][top-level]: no lexical binding defgeneric available
*** ERROR [nuseq][top-level]: no lexical binding subseq available
*** ERROR [nuseq][top-level]: no lexical binding seq available

This is resolved by using an external previous build of youtoo to bootstrap.

Split the “boot” section of Comptime2/Makefile

into the two parts to make the preliminary and final executables. Also move the “driver” part into the top-level Makefile.

Clean all .em files

to remove blank line at beginning, tabs and trailing white-space.

Add support in the REPL to load dynamically-linked module libraries

Add support for #;(sexp) comments in Runtime/Ff/eul-ntok.c

Add line-number counting to Runtime/Ff/eul-ntok.c

This also requires the introduction of a line-number counting stream to hold the line-number and provide access to the error reporting system.


Replace the use of error with read-error in read.em

Change the handling of multiple-escape sequences in eul-ntok.c

to correspond to the syntax for identifiers as described in the definition. Currently the handling of multiple-escape sequences is a duplicate of the handling for strings with all the special characters when the single escape character should only be required to escape itself and the multiple-escape character.

Add slice generic function and methods

slice for string can a wrapper around substring already available in Youtoo.

Add reverse! method for <string>

Requires equivalent ff in eul-ext.c

Sort out the syntax of character sequences

  • There is a problem with the need for double escaping: #\x000, #\\ etc.
  • Hexadecimal sequences are hard-coded to 3 digits, if not where is the end?
  • How should the character ‘^’ be written given that it is used to define control sequences e.g. #\^c ? Perhaps #\^ ?
Proposed solution

To remove support for control sequences which are unusual, system-dependent and can be created using hexadecimal characters. Also fix the number of hexadecimal digits for a character to 4 which is sufficient to support unicode but also avoids parsing problems.

Change the parser to map =’nil= to =’()=

so that (eq ‘nil ‘()) => t

(eql 3.0 3.0) should return t but it returns ()

Finish format

Currently format only handles a subset of the functionality in the definition, in particular e and g formatting of floating-point numbers is missing. format is complete in EuXLisp and it may be possible to reuse some of this functionality.

Enable level-0 modules to be loaded interactively

into a level1 environment by creating a dummy level-0 which is a copy of the default env

Include default environment variables directly into youtoo

to avoid the need for the start-up script to set them.

Add the -m load module option

compatible with the equivalent option added to EuXLisp.|

Add a Scheme-style else

for the default clause of cond forms. else is simply an alias for t.

Develop map and do to handle more than 2 sequences

for <list>, <vector> etc.

Fix output of very large and very small <double-float> numbers

print can output numbers of the order of 1e30 but does not use exponential format. There appears to be a limit on the number of decimal places that can be output which might relate to the size of on output formatting buffer.

Consider adding an expander for element to get-appl-expander

for <vector>, <string> and maybe =<list> in file ex-expr.em. This might avoid the generic function call overhead for returning an element of a primitive container.

Add support for Level-0 style super-class specification

If only one super-class is specified allow single-inheritance syntax of specifying the class directly rather than as a list.

Correct write ing of character digrams and escape sequences in strings

Correct defconstant to handle character constants correctly

See (deflocal nl #\\n) which should be (defconstant nl #\\n) in stream.em.

Improve --script option to handle module definition

See Examples/Test/factScript.em.

--script option should switch-off readline

Check Modules/Pipe

Currently the path /home/dm2/henry/EuLisp/EuLisp/Modules/Pipe/../../Bin.x86_64/youto is used which works but the equivalent /home/dm2/henry/EuLisp/EuLisp/Bin.x86_64/youto does not, nor does the relative path ../../Bin.x86_64/ which should.

Consider replacing the built-in GC with xalloc in Eu2C

Change level1 -> level-1 [3/3]

  • [X] Add level-1 as copy of level1
  • [X] Change all uses of level1 level-1
  • [X] Remove level1

Rename labels -> letfuns

Add support for hierarchical application of module filters


(defmodule test
  (import (level-1
           (rename ((something something-else))
                   (only (something)
  ) ; end of module

Complete support for eval

Following the analysis in the report “Modules, Macros and Lisp”, Queinnec and Padget, it is proposed to add eval to EuLisp with the following operator:
  • Add additional optional module argument to eval to set the environment in which the eval evaluates which defaults to the current module.

However, unlike the proposal in the report an additional restriction is added that it is exported environment in which eval operates rather than the complete lexical environment within the module. This restriction is necessary because only the exported environment is guaranteed to exist at “eval” time; the rest of the internal lexical environment may not be complete due to, for example, compiler optimisations.

The basic functionality is now complete and a simple example provided in Examples/Eval but currently there is no way to know what the current module is so the additional “optional” argument is currently required e.g.:

(eval (read lispin () ()) 'eval-test)

It may be possible to remove this limitation by either keeping a local variable in each module holding the module name or by converting eval into a macro so that the module name can be expanded into the optional argument slot during compilation. This is now implemented.


Finish reformatting the C source files

Add slice method for <list>

Add flush and sflush

Update the class hierarchy

  • remove <simple-string>, <simple-vector> etc.
  • add <sequence>, <character-sequence> etc.

Remove the export of <make-...> functions

Replace with generic make <...> calls in modules.

Rename primitive Scheme functions in the C-code

  ((begin progn)
  (pair? cons?)
  (real? float?)
  (real? double-float?)
  (procedure? function?)
  (eq? eq)
  (eqv? eql)))

Add binary-mod function

This is equivalent to binary% for integers but returns an <fpi> for <double-float>s, see definition.

Add time function

See Youtoo implementation

Switch-off readline when running a module with the -m option

Rename -length functions -> -size

Rename simple-vector -> vector

Complete double-float functionality

See Youtoo/Runtime/double.em

Consider replacing the built-in GC with xalloc from Eu2C

It is not clear this would provide much advantage as the current inefficiencies in EuXLisp are associated with the number of times the GC is called rather than the cost of the call.

Rename labels -> letfuns

Reorganise the FFI code in euxlBCodeCompiler.c

and make the strings associated with FFI stub compilation configurable; see void compileModuleFFI(const moduleFilesDef* modfiles).

Add support for building EuXLisp and FFI code with tinycc


  1. Currently tinycc does not support C99-style for-loop variable declarations which are used extensively in EuXLisp. It would be possible to add this support to tinycc but it is not clear how long it would take or if the developers would be interested.
  2. Another problem is the lack of support for __attribute__ ((constructor)) which is a gcc-ism for defining automatic initialisation functions in dynamic libraries used in the ffi stub loading. Again this functionality could be added to the ELF support in tinycc but it might be tricky and it is not clear if the developers of tinycc would be interested. An alternative would be to simulate the automatic calling of initialisation functions by looking them up with dlsym and calling them explicitly.


Hack CMUCL to write exponent “e”

C required double precision numbers to be written with “e” rather than the CL standard “d”.

Hack CMUCL to support symbols with post-fix “:”

Keywords in EuLisp are symbols with a post-fix “:” which is not allowed in standard CL except as an extension. Need to hack the CMUCL reader to support symbols with a post-fix “:”.

Reformat all CL and EuLisp code

to conform to a traditional CL style extended to handle the EuLisp specific forms, in particular defmodule. The eulisp-mode for Emacs supplied now conforms to this style and may be used to automatically re-indent code.

Reformat trailing parentheses in all CL and EuLisp code

Change the initlist keywords to use the post-fix “:”

Rename <fixed-precision-integer> -> <fpi>

Consider adding a special list for the keywords

Currently they are simply symbols which happen to end in a “:”.

Add support for the default superclass in defclass

Currently the superclass MUST be specified but the definition states that if the superclass is () then the default superclass <object> will be used.

Consider writing a defclass which supports multiple-inheritance

Currently only single-inheritance is supported by defclass as specified in EuLisp Level-0 but it should be possible to add support for a list of super-classes as specified in EuLisp Level-1.

Correct case handling for symbols

  • Currently symbols or interned with capitalised names.
  • This can only be corrected by enabling case-preservation in CL:
  • (setf (readtable-case readtable) :preserve)
  • The consequence is that all standard CL symbols must be written in uppercase.

Test current thread implementation in 32bit

If it proves effective consider writing the 64bit equivalents of the pieces of assembly code necessary for 64bit operation.

Consider replacing current setjmp/longjmp threads with pthreads

Change location of the [cho], {inst,def} and executable files

Currently the top-level Makefile does not set the location of the files which are build-dependant.

Replace equal with binary=

Remove the equal generic function and methods and introduce a complete set of binary= methods. The only difference between the definition of equal and binary= is the latter applies type coercion whereas equal was defined not two. If this property is an important feature equal could be reinstated as a function wrapper around binary= which does a type-consistency check.

Rename predicate functions

Rename predicates ending in “-p” and “p” to use the post-fix “?”. Add the post-fix “?” to atom and null.

Change prin, print and write to be n-ary

Add sprin, sprint and swrite to take the stream as the first argument.

Add sprint and change print to use stdout

Add sformat and change format to use stdout

Add required?: predicate keyword to class

Add abstract?: predicate keyword to class

Investigate the GC in 64bit

Examples/umdrehen.em fails in 64bit probably due to a memory allocation error.

Investigate the generate-*hack*

In file Apply/generate-def-file.ecl the generate-*hack* is necessary because

  1. the macro definitions are not yet moved to the def-file;
  2. variables imported from c are not moved to the def-file because include-statements for the c-preprocessor can’t be generated, due to the explicit declaration of c-import in the module interface without connection to the variable declarations.

Split defglobal and dynamic-??? from Apply/el2lzs-rules.ecl

into a level-1 file.

Create a level-1 module

including the level-0, dynamic and exit-1 modules.

Create the exit-1 module

containing the throw and catch functionality. Perhaps the syntax operators from Youtoo can be re-used for this.

Add support for generic-lambda

See Youtoo.

Investigate exposing MOP functionality from lzs-mop.ecl

It may be possible to expose the EuLisp Level-1 MOP functionality already present and use it in EuLisp modules, e.g. test-introspection.em

(%define-function (class-precedence-list <cons>)
  ((cl <class>))
  (%select cl <class> class-precedence-list))

(print (class-precedence-list <null>))

Renaming according to 1.0 proposals

  • Rename <execution-condition> as <general-condition>
  • Rename <syntax-error> as <read-error>
  • Rename <slot-description> as <slot> (and all other such references)
  • To remove <structure> and <structure-class>

Rename labels -> letfuns


Complete emacs mode eulisp-mode.el for EuLisp

Include emacs eulisp-mode.el in the git repository

Complete emacs inferior-mode inf-eulisp.el

for Youtoo and EuXLisp. It would not be useful for Eu2C which is non-interactive, i.e. no REPL.