diff --git a/src/CHANGELOG b/src/CHANGELOG index 9298cca6e..e84aa700e 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -622,8 +622,8 @@ ECLS 0.1a * SETF revised. Now it, and all accessors are implemented as macros with no special support from the interpreter. -ECLS 0.1b -========= +ECLS 0.2 +======== * Due to human errors, the bytecompiler shipped with 0.1a was not the finished version. In 0.1b we shipped a more polished files. Some of @@ -661,6 +661,28 @@ ECLS 0.1b designators, i.e. (nstring-upcase "aa" :start nil :end nil) causes an error. +ECLS 0.3 +======== + +* Add name mangling to ECLS: + - In the preprocessed files (*.d) @package::symbol can be used to + refer to a lisp function, while @'package::symbol can be used to + refer to a lisp symbol. The preprocessor translates these names + into valid C names. + - Function SI::MANGLE-NAME returns the C name for a lisp symbol + or function, and tells whether that symbol has been defined as + external C function already. + - A new proclamation + (proclaim '(si::c-export-fname union)) + advises the lisp->C translator to produce a C function with + mangle named (clLunion in this case), that can be directly called + from other translated files and from user written code. + - The dynamic loader can now reexport symbols from object files, + so that they become available to other files. + +* Remove variable si::*system-directory* and use logical hostname + "SYS:" instead. + TODO: ===== diff --git a/src/bare.lsp.in b/src/bare.lsp.in index 119faf1a5..31dba6187 100644 --- a/src/bare.lsp.in +++ b/src/bare.lsp.in @@ -24,10 +24,10 @@ (load "cmp/load.lsp") ;;; -;;; * By redefining *system-directory* ECLS will be able to +;;; * By redefining "SYS:" ECLS will be able to ;;; find headers and libraries in the build directory. ;;; -(setq si::*system-directory* (namestring (sys::chdir "./"))) +(si::pathname-translations "SYS" '(("*.*" "./*.*"))) ;;; ;;; * Add include path to not yet installed headers diff --git a/src/c/all_symbols.d b/src/c/all_symbols.d index 35075c002..e654e9ae0 100644 --- a/src/c/all_symbols.d +++ b/src/c/all_symbols.d @@ -151,7 +151,6 @@ const struct symbol_info all_symbols[] = { {&siVinhibit_macro_special, "*INHIBIT-MACRO-SPECIAL*", SI_SPECIAL}, /* main.c */ -{&siVsystem_directory, "*SYSTEM-DIRECTORY*", SI_SPECIAL}, {&clVfeatures, "*FEATURES*", CL_SPECIAL}, /* num_rand.c */ diff --git a/src/c/cinit.d b/src/c/cinit.d index c21bbb9cb..fa6b47b05 100644 --- a/src/c/cinit.d +++ b/src/c/cinit.d @@ -47,7 +47,7 @@ init_lisp_libs(void) SYM_VAL(@'*package*') = system_package; SYM_VAL(@'*features*') = CONS(make_keyword("ECLS-MIN"), SYM_VAL(@'*features*')); #ifdef RSYM - SYM_VAL(@'si::*symbol_table*') = make_simple_string("ecls_min.sym"); + SYM_VAL(@'si::*symbol_table*') = make_simple_string("SYS:ecls_min.sym"); #endif make_si_function("TOP-LEVEL", @si::simple-toplevel); } diff --git a/src/c/load.d b/src/c/load.d index 8f8658b6e..af68809be 100644 --- a/src/c/load.d +++ b/src/c/load.d @@ -194,8 +194,7 @@ build_symbol_table() { cl_object file; const char *tmpfile; - file = namestring(@merge-pathnames(2, SYM_VAL(@'si::*symbol-table*'), - SYM_VAL(@'si::*system-directory*'))); + file = coerce_to_filename(SYM_VAL(@'si::*symbol-table*')); tmpfile = file->string.self; if (!symbol_table_built) if (read_special_symbols(tmpfile) < 0) @@ -203,15 +202,6 @@ build_symbol_table() } #endif -const char * -system_directory() -{ - cl_object dir = SYM_VAL(@'si::*system-directory*'); - while (type_of(dir) != t_string) - FEerror("The value of sys::*system-directory* is not a string, ~A", 1, dir); - return dir->string.self; -} - /* ---------------------------------------------------------------------- */ #if 0 @@ -253,6 +243,6 @@ init_load(void) CONS(Cnil, load_source)); #ifdef RSYM - SYM_VAL(@'si::*symbol-table*') = make_simple_string("ecl.sym"); + SYM_VAL(@'si::*symbol-table*') = make_simple_string("SYS:ecls.sym"); #endif } diff --git a/src/c/main.d b/src/c/main.d index dfbfb31fd..9a24ae04b 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -44,7 +44,6 @@ int data_start = (int)&data_start; /******************************* EXPORTS ******************************/ cl_object clVfeatures; -cl_object @'si::*system-directory*'; const char *ecl_self; /******************************* ------- ******************************/ @@ -196,8 +195,6 @@ init_main(void) make_ordinary("LISP-IMPLEMENTATION-VERSION"); - SYM_VAL(@'si::*system-directory*') = make_simple_string("./"); - { cl_object features; features = CONS(make_keyword("ECLS"), diff --git a/src/c/pathname.d b/src/c/pathname.d index ecf552069..6e9b74c6f 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -1181,6 +1181,10 @@ translate_logical_pathname(cl_object source) void init_pathname(void) { + register_root(&pathname_translations); SYM_VAL(@'*default-pathname-defaults*') = make_pathname(Cnil, Cnil, Cnil, Cnil, Cnil, Cnil); + @si::pathname-translations(2,make_simple_string("SYS"), + list(1,list(2,make_simple_string("*.*"), + make_simple_string("./*.*")))); } diff --git a/src/clx/defsys.lsp.in b/src/clx/defsys.lsp.in index ab9bf375a..e11de9b0c 100644 --- a/src/clx/defsys.lsp.in +++ b/src/clx/defsys.lsp.in @@ -58,7 +58,7 @@ display) (display)))) ;; :source-directory "@srcdir@/" - :fasl-directory "./" - :library-directory "../") + :fasl-directory "@builddir@/clx/" + :library-directory "@builddir@/") ;; ;;; ---------------------------------------------------------------------- diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index 9210ab78e..545cb83a4 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -84,12 +84,12 @@ init_~A(cl_object) (format nil *ld-format* *cc* (namestring o-pathname) - (namestring sys::*system-directory*) + (namestring (translate-logical-pathname "SYS:")) options *ld-flags*))) (defun rsym (name) (let ((output (make-pathname :name (pathname-name name) :type "sym")) - (rsym (make-pathname :name "rsym" :defaults sys::*system-directory*))) + (rsym (translate-logical-pathname "SYS:rsym"))) (cond ((not (probe-file rsym)) (error "rsym executable not found")) ((not (probe-file name)) @@ -124,7 +124,7 @@ init_lisp_libs(void) (error "compiler::build-ecls wrong argument ~A" item)))) (format c-file " #ifdef RSYM - SYM_VAL(siVsymbol_table) = make_simple_string(\"~A.sym\"); + SYM_VAL(siVsymbol_table) = make_simple_string(\"SYS:~A.sym\"); #endif return;~%}~%" name)) (compiler-cc c-name o-name) @@ -468,7 +468,7 @@ Cannot compile ~a." (format nil *cc-format* *cc* *cc-flags* (>= *speed* 2) *cc-optimize* - (namestring sys::*system-directory*) + (namestring (translate-logical-pathname "SYS:")) (namestring c-pathname) (namestring o-pathname)) ; Since the SUN4 assembler loops with big files, you might want to use this: diff --git a/src/compile.lsp.in b/src/compile.lsp.in index b140d43e1..4252297d5 100644 --- a/src/compile.lsp.in +++ b/src/compile.lsp.in @@ -11,7 +11,7 @@ (proclaim '(optimize (safety 2) (space 3))) (sbt::operate-on-system lsp :library) (sbt::operate-on-system lsp :load) -(setq si::*system-directory* (namestring (sys::chdir "./"))) +(si::pathname-translations "SYS" '(("*.*" "./*.*"))) (setq compiler::*cc-flags* (concatenate 'string compiler::*cc-flags* " -I@srcdir@/h -I@srcdir@/gmp -I@builddir@/h")) #ifndef RUNTIME diff --git a/src/compile_rest.lsp.in b/src/compile_rest.lsp.in index 082507454..81fee2591 100644 --- a/src/compile_rest.lsp.in +++ b/src/compile_rest.lsp.in @@ -5,12 +5,8 @@ ;;; * Learn where we come from and where we go to ;;; (in-package "SYSTEM") -(*make-special '*ecls-srcdir*) ; defparameter is missing -(*make-special '*ecls-builddir*) -(setq *ecls-srcdir* #P"@srcdir@/") -(setq *ecls-builddir* (sys::chdir *ecls-srcdir*)) -(setq *system-directory* *ecls-builddir*) -(setq compiler::*cc-flags* (concatenate 'string compiler::*cc-flags* " -I@srcdir@/h -I@srcdir@/gmp ")) +(si::pathname-translations "SYS" '(("*.*" "./*.*"))) +(setq compiler::*cc-flags* (concatenate 'string compiler::*cc-flags* " -I@srcdir@/h -I@srcdir@/gmp -I@builddir@/h")) ;;; ;;; * Load system builder tool @@ -34,11 +30,9 @@ ;;; * Compile and link MIT CLX extensions ;;; (push :clx-ansi-common-lisp *features*) -(sys::chdir (merge-pathnames "clx/" sys::*ecls-builddir*)) (load "defsys.lsp") (sbt::operate-on-system clx :library) -(sys::chdir sys::*ecls-builddir*) (compiler::build-ecls "eclx" #ifndef RUNTIME 'cmp diff --git a/src/h/external.h b/src/h/external.h index 9bd5af8fa..0aa685305 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -448,7 +448,6 @@ extern void init_list(void); extern void init_load(void); extern void load_until_tag(cl_object stream, cl_object end_tag); extern void build_symbol_table(); -extern const char *system_directory(); /* lwp.c */ #ifdef THREADS diff --git a/src/h/lisp_external.h b/src/h/lisp_external.h index b29c983f9..7f43cc524 100644 --- a/src/h/lisp_external.h +++ b/src/h/lisp_external.h @@ -480,7 +480,6 @@ extern cl_object clLmacroexpand_1 _ARGS((int narg, cl_object form, ...)); /* main.c */ extern cl_object clVfeatures; -extern cl_object siVsystem_directory; extern cl_object clLquit _ARGS((int narg, ...)); extern cl_object siLargc _ARGS((int narg)); extern cl_object siLargv _ARGS((int narg, cl_object index)); diff --git a/src/lsp/autoload.lsp b/src/lsp/autoload.lsp index 65b6e31e8..46ad9942f 100644 --- a/src/lsp/autoload.lsp +++ b/src/lsp/autoload.lsp @@ -51,13 +51,13 @@ (unless (sys::specialp var) (return nil))))) (defun compile-file (&rest args) - (load (merge-pathnames sys:*system-directory* "compiler")) + (load "SYS:compiler") (apply 'compile-file args)) (defun compile (&rest args) - (load (merge-pathnames sys:*system-directory* "compiler")) + (load "SYS:compiler") (apply 'compile args)) (defun disassemble (&rest args) - (load (merge-pathnames sys:*system-directory* "compiler")) + (load "SYS:compiler") (apply 'disassemble args)) ) diff --git a/src/lsp/config.lsp.in b/src/lsp/config.lsp.in index 117826f01..47f44fd72 100644 --- a/src/lsp/config.lsp.in +++ b/src/lsp/config.lsp.in @@ -34,4 +34,4 @@ ;; * Set configuration pathnames. Notice the trailing slash! ;; Otherwise it would not be a directory. ;; -(setq sys:*system-directory* "@libdir@/") +(si::pathname-translations "SYS" '(("*.*" "@libdir@/*.*"))) diff --git a/src/lsp/describe.lsp b/src/lsp/describe.lsp index db05db70d..97d7631b0 100644 --- a/src/lsp/describe.lsp +++ b/src/lsp/describe.lsp @@ -541,7 +541,7 @@ q (or Q): quits the inspection.~%~ ;; where F means Function, V Variable and T Type. ;; (let* ((name (symbol-name symbol)) - (path (merge-pathnames *system-directory* "help.doc")) + (path "SYS:help.doc") (pos 0)) (labels ((bin-search (file start end &aux (delta 0) (middle 0) sym) diff --git a/src/lsp/top.lsp b/src/lsp/top.lsp index 8e880a78d..a8ee6f6ae 100644 --- a/src/lsp/top.lsp +++ b/src/lsp/top.lsp @@ -354,7 +354,8 @@ (incf i) (if (= i argc) (error "Missing directory") - (setq *system-directory* (argv i)))) + (setf (logical-pathname-translations "SYS") + `(("SYS:*.*" ,(concatenate (argv i) "*.*")))))) ((string= "-compile" (argv i)) (incf i) (if (= i argc)