aboutsummaryrefslogtreecommitdiff
path: root/src/lisp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-02-08 01:08:42 +0000
committerdos-reis <gdr@axiomatics.org>2010-02-08 01:08:42 +0000
commit3f8f61e055c818711c6a6136b89b6e9fedda8c3c (patch)
treeb6892bc44f1604fe03e29cdf7a28109a63adb370 /src/lisp
parent49820464da35e02649ec0d4107ac3ea4491e1620 (diff)
downloadopen-axiom-3f8f61e055c818711c6a6136b89b6e9fedda8c3c.tar.gz
Add support for CLozure CL.
* lisp/core.lisp.in: Add support for Clozure CL. (main): Remove as unused. * driver/utils.h (openaxiom_runtime): Add openaxiom_clozure_runtime. * boot/translator.boot (loadNativeModule): Handle Clozure CL. * boot/ast.boot (nativeType): Handle Clozure's FFI types. (nativeReturnType): Likewise. (coerceToNativeType): Likewise. (genCLOZUREnativeTranslation): New. (genImportDeclaration): Use it. * interp/vmlisp.lisp (SINTP): Remove duplicate definition. (SMINTP): Likewise. (ZERO?): Likewise. (GCMSG): Reorganize definition. (BPINAME): Likewise.
Diffstat (limited to 'src/lisp')
-rw-r--r--src/lisp/core.lisp.in47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in
index d12723b4..1d4882ad 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -3,7 +3,7 @@
;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
;; All rights reserved.
;;
-;; Copyright (C) 2007-2009, Gabriel Dos Reis.
+;; Copyright (C) 2007-2010, Gabriel Dos Reis.
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
@@ -190,7 +190,9 @@
#+:ecl #'si::top-level
#+:gcl #'si::top-level
#+:sbcl #'sb-impl::toplevel-init
- #+clisp #'system::main-loop)
+ #+clisp #'system::main-loop
+ #+:clozure nil ; don't know, kept private
+ )
;; Lisp source file extension.
(defconstant |$LispFileType| "lisp")
@@ -404,7 +406,6 @@
option)))))
(values options-so-far argv)))
-
;;
;; -*- Building New Lisp Images -*-
;;
@@ -468,6 +469,12 @@
:norc t
))
(ext::quit))
+ #+:clozure (progn
+ (ccl:save-application core-image
+ :toplevel-function entry-point
+ :error-handler :quit
+ :prepend-kernel t)
+ (return-from |saveCore|))
(error "don't know how to save Lisp image"))
@@ -489,7 +496,8 @@
#+:clisp (ext:quit status)
#+:gcl (si::bye status)
#+:ecl (ext:quit status)
- #-(or :sbcl :clisp :gcl :ecl)
+ #+:clozure (ccl:quit status)
+ #-(or :sbcl :clisp :gcl :ecl :clozure)
(error "`coreQuit' not implemented for this Lisp"))
@@ -592,9 +600,10 @@
;; Command line arguments: equivalent of traditional `argv[]' from
;; systems programming world.
(defun |getCommandLineArguments| nil
- #-(or :gcl :sbcl :clisp :ecl)
+ #-(or :gcl :sbcl :clisp :ecl :clozure)
(|fatalError| "don't know how to get command line args")
(let* ((all-args
+ #+:clozure ccl:*command-line-argument-list*
#+:ecl (ext:command-args)
#+:gcl si::*command-args*
#+:sbcl sb-ext::*posix-argv*
@@ -604,31 +613,6 @@
;;
-;; -*- Program Startup -*-
-;;
-
-;; The top level entry point to most saved Lisp image.
-(defun |main| nil
- (setq *package* (find-package "BOOT"))
- ;; Existing system programming practive, and POSIX, have it
- ;; that the first argument on the command line is the name
- ;; of the current instantiation of the program.
- ;; We require at least two arguments:
- ;; (0) the program name
- ;; (1) either one of --help or --version, or
- ;; a filename.
- (let ((command-args (|getCommandLineArguments|)))
- (when (null command-args)
- (|internalError| "empty command line args"))
- (when (fboundp '|main|)
- (|coreQuit| (funcall '|main| command-args)))
-
- ;; Huh, the main entry point was not defined.
- (|fatalError| "missing definition for main function")
- (|coreQuit| 1)))
-
-
-;;
;; -*- Building Standalone Executable -*-
;;
;; Build a standalone excutable from LISP-FILES -- a list of
@@ -715,6 +699,7 @@
)
+
;;
;; -*- --help Handler -*-
;;
@@ -887,7 +872,7 @@
;; Run the system-specific initialization.
(when (fboundp '|%sysInit|)
- (funcall '|%sysInit|))
+ (funcall (symbol-function '|%sysInit|)))
(when (|handleCommandLine| (car command-args) options args)
(|coreQuit| (if (> (|errorCount|) 0) 1 0))))))