3 ms·
> I don't understand why languages don't have a 'version' id as the very first thing, and then you can run appropriate interpreter/compiler given the version.
by lispm 3y ago
> I don't understand why languages don't have a 'version' id as the very first thing, and then you can run appropriate interpreter/compiler given the version.
Common Lisp may have that. My Symbolics Lisp Machine runs six different Common Lisp variants and additionally ZetaLisp side by side in one system.
There are often feature symbols which note language versions: CLtL1, CLtL2, ANSI90, ANSI-CL. It also has packages, where LISP will mean symbol table with CLtL1 symbols and COMMON-LISP will mean a symbol table with CLtL2 symbols.
> New versions of the language can drop historical mistakes.
Lisp may not work that way:
Lisp is not just a language, it is a running system. One can load many different libraries and programs into one running Lisp. Some older code will use CAR/CDR and some newer code won't. It still runs side by side in the same ONE environment and will call each other.
I can for example say:
#+ansi-cl (print "this is code for an ANSI CL compatible Common Lisp")
#-ansi-cl (error "this is Common Lisp does not support ANSI CL")
This will check if the Common Lisp has the features ANSI-CL.
Since cons cells and lists made of cons cells are so fundamental to Lisp, that it would be painful to support software where such a core data structure would be changed (for example by renaming the core operators).
Again, code from several decades with different language variants can be running in one Lisp.