[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Common Lisp Subset

It was appeared as WGSYM 34-4 IPSJ Nov. 1985.
      WGSYM is Working Group on Symbol Manipulation
      IPSJ is Information Processing Society of Japan.
and was the base for subsetting discussions in Japan.
The paper is attached here.
We have a continuous talk with this paper for polishing it up.
We have a working group for it under CommonLisp committee at Jeida.
The group meeting was held twice-a-month schedule from Dec.1985 till now.
The polished version will be apperead at July 8th meeting.

The primary members are
  Masayuki Ida,
  K. Yuura (Hitachi),
  H. Kato(Fujitsu),
  S. Kawai (DEC japan),
  Y. Hashimoto(NEC),
  K. Umemura(NTT),
  S. Harada (Sharp)
  Y. Yamamura (Nippon Univac),
  K. Kawagome(Sord)
  and some other members extended from this April.
  Mr. Yuura is the chair of the working group.

I hope this subset efforts will assist you, if you are considering
a two-level language spec like Fortran.
I feel the current disccusions on Common-lisp@su-ai have a tendency to
make Common Lisp fat, not slim.
Of cause it is needed to include rich functionality into Common-lisp,
but there are small sized machines which can not use the "full-set" CommonLisp.
I am not so enthusiastic to make a subset, but I think it will be needed,
and I have a continuous interest to make a subset or a core Common Lisp.

Here is my paper on Nov. 1985
(M.Ida: A Common Lisp Subset Proposal", WGSYM 34-4, IPSJ Nov. 1985)

        A Common Lisp Subset Proposal

                Masayuki Ida
        Assoc.Prof, Aoyama Gakuin University
        Chair. Jeida Common Lisp Committee

Make Common Lisp slim. Don't cut arms and legs

One and only one official subset for Common Lisp.It prevents
us   from   divergence   of   language  specification  among
CommonLisp-LIKE lisps

********** extracted from WGSYM 34-4 ***********

1) Is this proposal for personal computer based  implementa-
tion? ---> Yes and No
     YES: As prof. Fahlman said in [Fah85], personal comput-
er  will  grow  to have much more memory space and secondary
storages. Large size personal computer will be  possible  to
run  full set Common Lisp.  But, there is a price range fac-
tor. There will be still low-end computers with  popularity.
Price  of  the  machine  which may run this subset can range
among a few thousand dollars.
     No: The decision upon defining subset  should  not  in-
clude the restrictions drived from the current technology.

2) How small or slim?
     A subset which is very small, cannot  play  the  actual
roles.   For example, Minimal Basic seems to be dead now for
almost every scene.  Then this subset of  CommonLisp  should
not  go  to  extremes.  The author have an image in mind the
size is about half of full set.  And may be more  than  50%,
but not greatly less than 50%.

3) What is the basic policy?
  Don't cut arms and legs of Common Lisp

4.2 Some technical issues

1) Do we assume compiler? ----> Yes
     Interpreter     plays     a     role     of     command
interpreter/debugger.   As  a  matured  language, a compiler
should be equipped.

2) DO we keep the type hierarchy? ---> Yes
     Omit some types, but, preserve hierarchy (for  example,
character type is independent from number)

3) Do we omit sequence type? ---> No
        (for user friendlyness)

4) Do we need complex numbers? ---> No

5) Do we need the visibility of system constants  and  vari-
  ---> No (some variables and constants are left)

6) Do we need complete function sets of numbers? ---> No
     preserve types except Complex numbers.   delete  almost
all the irrational functions

7) Do we need hash-table?  ---> No

8) Do we need dynamic properties of array? ---> No
     Only simple and static array.  no fill-pointers, no ad-
justable  array,  no bit array.  three dimension, not seven,
is enough.

9) How about the format feature? ---> there are two ways
  1. limit the field specifier set,consulting fortran case.
   subset F77 has I, F, E, L, A, '...', H, X, /, P, N, Z, BZ
   subset F77 does not have colon, S, SP ,SS, T, TL, TR,  G,
and list directed editing.
  2. exclude all the spec of format from subset
  ---> include format with restricted syntax

10) How about lambda list keyword? ---> make it slim
     only &optional and &rest

11) Will include the object oriented facility? ---> No.
     CommonLOOPS[Bob85] will be the standard after some dis-
cussions.  But not include in this subset.

12) Do we include go/prog/tagbody? --->No
     "go" structure should  be  rewritten  with  other  con-
structs.  In  Common  Lisp, go is not always equivalent to a
simple jump instruction.  prog is obsolete.  If there is  no
"go", tagbody is meaningless.

13) Keyword arguments ?    -> restrict to the special cases.
So  parser  will  be  easier ( general parsing mechanism for
keyword is not needed)

5.Summary of the subset spec

Total: 330 functions, 2 constants, 7 variables (Table 1).
  Notation of the following summary:
    1) listed elements are included in subset spec.
    2) single braketted elements ([ ... ]) are OMITTED.
    3) double braketted elements ([[ ... ]])
   have RESTRICTED syntax/semantics
    4) triple braket ([[[ ... ]]]) contains comments

Chapter 2 Data Type

     number, integer, fixnum, bignum, ratio,  float,  short-
float,single-float,  double-float,  long-float,  [omit: com-
     character,  standard-char,   string-char,   [[[comment:
bits-attribute and font-attribute may be zero]]]
     array, [[restricted: max rank=3,  array  means  simple-
array]], [omit: bit vector]
     [hash table]
     [[ readtable;restricted to only one readtable]]
     [package, pathname, stream, random-state]
     structure, function
     2.15 type overlap,inclusion,disjointeness
     [[[ preserve data type hierarchy of full set.   hierar-
chy figure is defined as in [ida84] ]]]

Chapter 3. Scope and Extent
     [[[same scoping as full set]]]

Chatpter 4. type specifier
     standard type specifiers of  Fig.4.1  are  all  active,
coerce,  typeof, readtable, simple-array, simple-bit-vector,
simple-string, simple-vector
     [bit, bit-vector,complex,hash-table, stream, ]
     [And omit functions such  as  deftype,  type  specifier
combination, predicating specifier(satisfies)]

Chapter 5. Porgram structure (2 functions)
     [omitted functions from  Fig  5.1;  tagbody,  macrolet,
flet, compiler-let, eval-when,go]
     [&key,&allow-other-keys,&aux from lambda-list  keyword,
lambda-list-keyword,  lambda-parameters-limit, defparameter,

Chapter 6. predicates (27 functions, 2 constants)
     nil, t, typep, subtypep, null,  symbolp,  atom,  consp,
listp,  numberp,  integerp,  rationalp,  floatp, characterp,
stringp, vectorp, simple-vector-p, simple-string-p,  arrayp,
packagep,  functionp, compiled-function-p, commonp, eq, eql,
equal, not, and, or
     [complexp, bit-vector-p, simple-bit-vector-p, equalp]

Chapter  7. Control Structure (51 functions)
     quote, function, symbol-value, symbol-function, boundp,
fboundp,   special-form-p,  setq,  psetq,  set,  makunbound,
fmakunbound, setf, apply, funcall, progn, prog1, prog2, let,
let*,  progv,  labels,  if, when, unless, cond, case, block,
return-from, return, loop, do,  do*,  dolist,  dotimes,  ma-
plist,  mapcar,  mapc, mapl, mapcan, mapcon, values, values-
list, multiple-value-list,  multiple-value-prog1,  multiple-
value-bind, multiple-value-setq, multiple-value-call, catch,
unwind-protect, throw
        [psetf,  shiftf,  rotatef,   defsetf,   define-setf-
method,   define-modify-macro,   get-setf-method,  get-setf-
method-multiple-value,  call-argument-limit,   compiler-let,
flet, macrolet, prog, go, typecase, tagbody]

setf accessible forms;
     aref, car, cdr, c...r, fill-pointer, first, get,  getf,
nth,  nthcdr,  rest,  second, symbol-function, symbol-plist,
symbol-value, third, access function of defstruct,
     [omitted        access        form;        elt,fourth--
tenth,svref,gethash,documentation,  c....r,  macro-function,
(char,  schar,  bit,  sbit,  subseq)  function  calls,  the-
declaration, apply ]

Chapter 8. Macro (5 functions)
     macro-function,    defmacro,    macro,     macroexpand,
     [[ defmacro keywords only to &optional and &rest]]
     [omit  *macro-expand-hook*,  &key,   &allow-other-keys,
&aux, &body, &whole, &environment]

Chapter 9. Declarations (2 functions)
     Only (declare (special ...)) acceptable
     [omit all the spec of declarations but above]
     [[["the" acceptable but not effective]]]

Chapter 10. Symbols (10 functions)
     get, remprop, symbol-plist, getf, remf, symbol-name,
     make-symbol, copy-symbol, gensym, keywordp
     [get-properties, gentmp, symbol-package]

Chapter 11. Package (1 function)
     [All the  spec  of  Package  features  are  omitted,but
     11.1 consistency rules, intern

Chapter 12. Number (51 functions)
     zerop, plusp, minusp, oddp, evenp, =, /=, <, >, <=, >=,
max,  min,  +,  -,  *, /, 1+, 1-, incf, decf, gcd, lcm, exp,
expt, log, sqrt, abs, signum, sin, cos, tan,  rational,  ra-
tionalize,  numerator,  denominator,  float, floor, ceiling,
truncate, round, mod, rem, logior, logxor,  logand,  logeqv,
lognot, logtest. logbitp, ash
     [[ complex related features of above fuctions are omit-
     [  complex  and  byte-manipulation  functions,  random-
numbers, implementation parameters described in 12.10.
     conjugate, isqrt, phase, cis,  asin,  acos,  atan,  pi,
sinh,  cosh,  tanh,  sinh,  acosh,  atanh, ffloor, fceiling,
ftruncate,  fround,  decode-float  --  integer-decode-float,
complex,  realpart,  imagpart,  lognand, logandc1, logandc2,
logorc1, logorc2, boole, bool-  constants  byte,  byte-size,
byte-position,  ldb,  ldb-test,  mask-field,  dpb,  deposit-
field, random, *random-state*, make-random-state  ]

Chapter 13. Characters (21 functions)
     standard-char-p,  alpha-char-p,   upper-case-p,   both-
case-p,  digit-char-p,  char=,  char/=, char<, char<=, char-
code, code-char, make-char, char-upcase,  digit-char,  char-
int,  int-char,  char-downcase,  char-name, name-char, char-
bit, set-char-bit

     [  char-code-limit,  char-font-limit,  char-bits-limit,
graphic-char-p,  string-char-p,  alphanumericp,  char-equal,
char-not-equal,   char-lessp,    char-greaterp,    char-not-
greaterp,  char-not-lessp,  char>, char>=, 13.5 char control
bit functions  ]

Chapter 14. Sequences (17 functions)
     subseq,  reverse,  nreverse,   some,   every,   notany,
notevery, sort
     [[as to fill pointer:: elt,length]]
     [[as to :start - :end ::   remove,  remove-if,  remove-
if-not, remove-duplicates, find, position, count]]

     :count, :from-end, :strat,  :end,  make-sequence,  con-
catenate,  map,  reduce,  fill,  replace, delete, delete-if,
delete-if-not, delete-duplicates, substitute, substitute-if,
substitute-if-not,        nsubstitute,       nsubstitute-if,
nsubstitute-if-not,   find-if,   find-if-not,   position-if,
position-if-not,  count-if,  count-if-not, mismatch, search,
stable-sort, merge  ]

Chapter 15. list (62 functions)
     car, cdr, c..r, c...r, cons,  tree-equal,  endp,  list-
length, nth, first, second, third, rest, nthcdr, last, list,
list*,  append,  copy-list,  copy-alist,  copy-tree,  nconc,
push,   pushnew,  pop,  butlast,  nbutlast,  ldiff,  rplaca,
rplacd, pairlis

     [[keyword not allowed; subst, nsubst,  sublis,  member,
member-if,  member-if-not,  adjoin, union, nunion, intersec-
tion, nintersection, set-defference,  nset-difference,  set-
exclusive-or,  nset-exclusive-or,  assoc,assoc-if, assoc-if-
not, rassoc, rassoc-if, rassoc-if-not]]

     [c....r,  fourth  --   tenth,   make-list,   revappend,
nreconc,  subst-if,  subst-if-not, nsubst-if, nsubst-if-not,
subsetp, acons, tailp]

Chapter 16. Hash-table (0 functions)
        [ ALL ]

Chapter 17. Array (6 functions)
     vector,  aref,  array-rank,  array-in-bounds-p,  array-

     [[ make-array( limit to three dimensions  (not  seven),
all  the  keyword arguments but :initial-contents are delet-

[  array-rank-limit,   array-dimension-limit,   array-total-
size-limit,   svref,   array-elemet-type,   array-dimension,
array-dimensions, array-row-major-index, adjustable-array-p,
bit,  sbit,  bit-and,  bit-or, ..., bitorc2, bit-not, array-
has-fill-pointer-p, fill-pointer, vector-push,  vector-push-
extend,  vector-pop, adjust-array, 17.4 all (bit-array),17.5
all (fill pointer),17.6 all (augumentation of dimension)  ]

Chapter 18. string (9 functions)
     char, string-trim, string-left-trim, string-right-trim,

     [[  subseq(:start  and  :end)  related  restriction  ::
string=, string/=, string<, string<=]]

     [schar, string>, string>=, string-equal,  string-lessp,
...,make-string,  string-upcase,  string-downcase,  nstring-
upcase, nstring-down-case, nstring-capitalize]

Chapter 19. structure (1 functions)
        [[ defstruct ]]

        [  :type,:read-only  (in  defstruct  slot   option),
:conc-name,  :constructor,  :copier,  :predicate,  :include,
:print-function, :type, :named,  :initial-offset  (in  defs-
truct option), by-position constructor ]

Chapter 20. Evaluator (1 function)
     [ evalhook, applyhook,  *evalhook*,  *applyhook*,  con-
stantp, +, ++, +++, -, *, **, ***, /, //, /// ]

Chapter 21. stream (1 function, 7 variables)
     *standard-input*,  *standard-output*,   *error-output*,
*query-io*, *debug-io*, *terminal-io*, *trace-output*

     [[ close (No :abort arg) ]]
     [make-synonym-stream,   make-...-stream,    get-output-
stream-string,    with-input-from-string,    with-output-to-
string,streamp,  input-stream-p,  output-stream-p,   stream-
element-type ]

Chapter 22. input/output (22 functions)

 22.1.4 dispatching macro character

 22.1.5  [*readtable*,  copy,  readtable,  readtablep,  set-
syntax-from-char,   set/get-macro-character,  make-dispatch-
macro-character, set/get-dispatch-macro-character ]
 22.1.6 [*print-...* all omitted]
 22.2 input
     read, read-line, read-char, unread-char, listen,  read-
char-no-hang, clean-input, read-byte
     [*read-default-float-format*,          read-preserving-
whitespace, read-delimited-list, peek-char, parse-integer]
     [[ read-from-string (no keyword arg) ]]

 22.3 output
     write-byte,  prin1,  print,  pprint,  princ,  prin1-to-
string,  princ-to-string,  write-char,  terpri,  fresh-line,
format, y-or-n-p, yes-or-no-p

 22.3.3 format specifier:
     ~A, ~S, ~D, ~X, ~C, ~F, ~E, ~%, ~&, ~|, ~~, ~<newline>,
     [~B,  ~O,  ~nR,  ~P,  ~G,  ~$,  ~T,  ~*,  ~?,  ~(str~),

Chapter 23.file system interface (11 functions)

 23.1 file name pathname
     file name should be string
     [all the pathname related definitions are omitted]
 23.2 file open/close
     [[file name should be string (:direction is Only  input
or  output,  :element-type  is only string-char or unsigned-
byte,  :if-exists  omitted,  :if-does-not-exist  omitted)]],
 23.3 rename-file, delete-file, probe-file, file-write-date,
file-author, file-position, file-length
 23.4 [[load(no keyword)]], [*load-verbose*]
 23.5 directory

Chapter 24. error (4 functions)
     error, cerror, warn, break
     [ *break-on-warning*,  check-type,  assert,  etypecase,
ctypecase, ecase, ccase]

Chapter 25. miscellaneous (26 functions)
     compile, compile-file, documentation,  trace,  untrace,
step,time,  describe,  inspect, room, ed, dribble, appropos,
appropos-list,   get-decoded-time,    get-internal-run-time,
get-internal-real-time,   sleep,   lisp-implementation-type,
*features*,    lisp-implementation-version,    machine-type,
machine-version,  machine-instance, software-type, software-

     [disassemble,    get-universal-time,     decode/encode-
universal-time,  internal-time-units-per-second, short-site-
name, long-site-name, identity]

------------------------end  of  the   document   ----------