Programming Language Eulisp, Version 0.99
Total Page:16
File Type:pdf, Size:1020Kb
Programming Language Eulisp Version Programming Language EuLisp version Contents Page Foreword Intro duction Language Structure Scop e Conformance Denitions Error Denitions Compliance Conventions Layout and Typ ography MetaLanguage Naming Denitions Syntax Whitespace and Comments Ob jects Mo dules Directives Exp ort Directive Imp ort Directive Exp ose Directive Syntax Directive Denitions and Expressions Mo dule Pro cessing Mo dule Denition Ob jects System Dened Classes Single Inheritance Dening Classes Dening Generic Functions and Metho ds Sp ecializin g Metho ds Metho d Lo okup and Generic Dispatch Creating and Initializi ng Ob jects Accessing Slots Concurrency Threads Lo cks Conditions Condition Classes Condition Handling ii Programming Language EuLisp version Expressions Denitions and Control Forms Simple Expressions Functions creation denition and application Destructive Op erations Conditional Expressions Variable Binding and Sequences Events Quasiquotation Expressions Summary of Level Expressions and Denitions Syntax of Level dening forms Syntax of Level expressions Syntax of Level macros Annexes ALevel Mo dule Library A Characters A Collections A Comparison A Conversion A Copying A Double Precision Floats A Elementary Functions A Floating Point Numbers A Fixed Precision Integers AFormattedIO AIntegers ALists ANumbers AStreams AStrings ASymbols ATables AVectors ASyntax of Level ob jects B Programming Language EuLisp Level B Classes and Ob jects B Generic Functions B Metho ds B Ob ject Introsp ection B Class Introsp ection B Slot Introsp ection B Generic Function Introsp ection B Metho d Introsp ection B Class Initializa tion B Slot Description Initializa tion B Generic Function Initializ ation B Metho d Initializati on B Inheritance Proto col B Slot Access Proto col B Metho d Lo okup and Generic Dispatch B LowLevel Allo cation Primitives B Dynamic Binding B Exit Extensions B Summary of Level Expressions and Denitions B Syntax of Level dening forms B Syntax of Level expressions B Syntax of Level macros Indexes Class Index Condition Index ConstantIndex Function Index Macro Index Generic Function Index Metho d Index iii Programming Language EuLisp version General Index Figures Example of mo dule directives Example mo dule using expose Level initial class hierarchy Level initial condition class hierarchy Illustration of handler actions Example using letcc Interaction of unwindprotect with nonlo cal exits A Level numb er class hierarchy B Level class hierarchy B Initializati on Call Structure Tables Mo dules comprising eulisplevel Minimal character set Syntax of ob jects for reading and writing Mo dule syntax defstruct syntax defgeneric rewrite rules A Character Syntax A Summary of comparison functions A Floating Point Syntax A Integer Syntax A Pair and List Syntax A Examples of string literals A String Syntax A IdentierSymb ol Syntax A Vector Syntax iv COMMITTEE DRAFT Programming Language EuLisp version Programming Language EuLisp version In the b eginning the work of the EULISP group was sup p orted by the institutions or companies where the partici pants worked but in DG XI I I Information technol ogy directorate of the Commission of the Europ ean Com munities agreed to supp ort the continuation of the work ing group by funding meetings and providing places to meet It can honestly b e said that without this supp ort EULISP would not have reached its presentstate In ad dition the EULISP group is grateful for the supp ort of British Council in France Alliance programme British Council in Spain Acciones Integradas programme British Council in Germany Academic Research Collab oration pro gramme British Standards Institute Deutscher Akademis cher Austauschdienst DAAD Departament de Llenguat ges i Sistemes Informatics LSI Universitat Politecnica de Catalunya Fraunhofer Gesellschaft Institut fur Software Foreword und Systemtechnik Gesellschaft fur Mathematik und Daten verarb eitung GMD ILOG SA Insiders GmbH Institut The EULISP group rst met in Septemb er at IRCAM National de Recherche en Informatique et en Automatique in Paris to discuss the idea of a new dialect of Lisp which INRIA Institut de Recherche et de Co ordination Acous should b e less constrained by the past than Common Lisp tique Musique IRCAM Rank XeroxFrance Science and and less minimalis t than Scheme Subsequent meetings for Engineering Research Council UK Siemens AG University mulated the view of EULISP that was presented at the of Bath UniversityofTechnology Delft University of Edin ACM Conference on Lisp and Functional Programming held burgh Universitat Erlangen and UniversiteParis VI LITP at MIT Cambridge Massachusetts and at the Euro p ean Conference on Articial Intelligence ECAI held The following p eople in alphab etical order have con in Brighton Sussex Since then progress has not b een tributed in various ways to the evolution of the language steady but happ ening as various p eople had sucient time ejar Russell Bradford Harry Giusepp e Attardi Javier B and energy to develop part of the language Consequently Bretthauer Peter Broadb ery Christopher Burdorf Jerome although the vision of the language has in the most part Chailloux Thomas Christaller Je Dalton Klaus Daler b een shared over this p erio d only certain parts were turned Harley Davis David DeRoure John Fitch Richard Gabriel into physical descriptions and implementations For a nine Brigitte Glas Nicolas Graub e Dieter Kolb Jurgen Kopp month p erio d starting in January through the supp ort Antonio Moreno Eugen Neidl Pierre Parquier Keith Play of INRIA it b ecame p ossible to start writing the EULISP ford Willem van der Po el Christian Queinnec Enric Sesa denition Since then aairs have returned to their previ Herb ert Stoyan and Richard Tobin ous state but with the evolution of the implementation s of EULISP and the background of the foundations laid by the The editors of the EULISP denition wish particularly to ac INRIAsupp orted work there is convergence to a consistent knowledge the work of Harley Davis on the rst versions of and practical denition the description of the ob ject system The second version was largely the work of Harry Bretthauer with the assistance of The acknowledgments for this denition fall into three cate Jurgen Kopp Harley Davis and Keith Playford gories intellectual p ersonal and nancial Julian Padget japmathsbathacuk The ancestors of EULISP in alphab etical order are Common Scho ol of Mathematical Sciences Lisp I nterLISP LELISP LISPVM Scheme and University of Bath T Thus the authors of this rep ort are pleased to Bath Avon BA AY UK acknowledge b oth the authors of the manuals and denitions of the ab ove languages and the many who have dissected and extended those languages in individ ual pap ers The various Greg Nuyens nuyensilogcom pap ers on Standard ML and the draft rep ort on Haskell ILOG SA have also provided much useful input Avenue Gallieni Gentilly CEDEX FRANCE The writing of this rep ort has at various stages b een sup p orted by Bull SA Gesellschaft fur Mathematik und Daten verarb eitung GMD Sankt Augustin Ecole Polytechniqu e editors LIX ILOG SA Institut National de Recherche en Infor matique et en Automatique INRIA University of Bath and UniversiteParis VI LITP The authors gratefully ac knowledge this supp ort Many p eople from Europ ean Com munitycountries have attended and contributed to EULISP meetings since they started and the authors would liketo thank all those who have help ed in the development of the language Programming Language EuLisp version necessary But this is not the place for a detailed language comparison That can b e drawn from the rest of this text EULISP breaks with LISP tradition in describing all its typ es in fact classes in terms of an ob ject system This is called The EULISP Ob ject System or TELOS TELOS incorp orates elements of the Common Lisp Ob ject System CLOS Ob jVLisp Oaklisp MicroCeyx and MCS Language Structure The EULISP denition comprises the following items Intro duction Level comprises all the level functions macros EULISP is a dialect of Lisp and as suchowes much to the and sp ecial forms which is this text minus Annex B The great b o dy of work that has b een done on language design in ob ject system can b e extended by userdened structure the name of Lisp over the last thirtyyears The distinguish classes and generic functions ing features of EULISP are i the integration of the classical Lisp typ e system and the ob ject system into a single class Level extends level with the functions macros hierarchy ii the complementary abstraction facilities pro and sp ecial forms dened in Annex B The ob ject system vided by the class and the mo dule mechanism iii supp ort can b e extended by userdened classes and metaclasses for concurrent