armedbear

=?X-UNKNOWN?Q?Andr=E1s_Simon?= <[email protected]> Wed, 17 Dec 2003 18:30:33 +0100 (CET)
Newsgroups gmane.lisp.ilisp.devel
Message-ID <[email protected]>
This is a patch and two files which provide some support for Armedbear
Lisp. Would it be possible to include this in ilisp?

Andras

First the patch:

Index: cl-ilisp.lisp
===================================================================
RCS file: /cvsroot/ilisp/ILISP/cl-ilisp.lisp,v
retrieving revision 1.21
diff -c -r1.21 cl-ilisp.lisp
*** cl-ilisp.lisp	3 Nov 2003 04:40:16 -0000	1.21
--- cl-ilisp.lisp	17 Dec 2003 15:55:27 -0000
***************
*** 151,157 ****

  ;; MNA: ecl (ecls-0.5) still had special-form-p in COMMON-LISP,
  ;; which produced an error, when redefined.
! #+(and (or :cormanlisp :ansi-cl) (not :ecl))
  (defun special-form-p (symbol)
    "Backward compatibility for non ANSI CL's."
    (special-operator-p symbol))
--- 151,157 ----

  ;; MNA: ecl (ecls-0.5) still had special-form-p in COMMON-LISP,
  ;; which produced an error, when redefined.
! #+(and (or :armedbear :cormanlisp :ansi-cl) (not :ecl))
  (defun special-form-p (symbol)
    "Backward compatibility for non ANSI CL's."
    (special-operator-p symbol))
***************
*** 499,504 ****
--- 499,507 ----
  	   #+allegro
  	   (excl::arglist symbol)

+ 	   #+armedbear
+ 	   (ignore-errors (ext:arglist symbol))
+
  	   #+(or ibcl kcl gcl)
  	   (help symbol)

***************
*** 523,529 ****
  	   #+:openmcl
  	   (arglist symbol (symbol-package symbol))

! 	   #-(or allegro lucid kcl ibcl ecl gcl lispworks clisp cmu :sbcl :openmcl)
  	   (documentation symbol 'function)))))


--- 526,532 ----
  	   #+:openmcl
  	   (arglist symbol (symbol-package symbol))

! 	   #-(or allegro armedbear lucid kcl ibcl ecl gcl lispworks clisp cmu :sbcl :openmcl)
  	   (documentation symbol 'function)))))


***************
*** 540,546 ****
--- 543,551 ----
  	    ;; (ilisp-message t "symbol ~S not present in ~S." symbol package)
  	    (values))
  	   ((special-form-p real-symbol)
+ 	    #-armedbear
  	    (format t "~S: special-operator." real-symbol)
+ 	    #+armedbear (print-function-arglist real-symbol)
  	    (values))
  	   ((fboundp real-symbol)
  	    (print-function-arglist real-symbol))
Index: ilisp.el
===================================================================
RCS file: /cvsroot/ilisp/ILISP/ilisp.el,v
retrieving revision 1.10
diff -c -r1.10 ilisp.el
*** ilisp.el	13 Dec 2003 23:43:44 -0000	1.10
--- ilisp.el	17 Dec 2003 15:55:28 -0000
***************
*** 143,148 ****
--- 143,149 ----
  (load "ilisp-sbcl")
  (load "ilisp-chs")
  (load "ilisp-acl")
+ (load "ilisp-armedbear")
  (load "ilisp-hlw")
  (load "ilisp-kcl")
  (load "ilisp-luc")



Now the files:

;;armedbear.lisp

;;; -*- Mode: Lisp -*-

;;; armedbear.lisp --
;;; ILISP Armedbear Lisp dialect support definitions.
;;;
;;; This file is part of ILISP.
;;; Please refer to the file COPYING for copyrights and licensing
;;; information.
;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
;;; of present and past contributors.


(in-package :cl)

(defun pprint (object &optional stream)
  (print object stream))


;;; end of file -- armedbear.lisp --

;;ilisp-armedbear.el

;;;;; -*- Mode: Emacs-Lisp -*-

;;; ilisp-armedbear.el --
;;; ILISP Armedbear Lisp dialect definition
;;;
;;; This file is part of ILISP.
;;; Please refer to the file COPYING for copyrights and licensing
;;; information.
;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
;;; of present and past contributors.
;;;


;;;%%%Armedbear
(defvar ilisp-armedbear-init-file "armedbear.lisp")

(defun armedbear-check-prompt (old new)
  "Compare the break level printed at the beginning of the prompt."
  (let* ((old-level (if (and old (eq 1 (string-match "[0-9]+" old)))
 			(string-to-int (substring old 1))
 			0))
 	 (new-level (if (eq 1 (string-match "[0-9]+" new))
 			(string-to-int (substring new 1))
 			0)))
    (<= new-level old-level)))

;;;
(defdialect armedbear "Armedbear LISP"
  common-lisp
  (ilisp-load-init 'armedbear ilisp-armedbear-init-file)
  ;; (ilisp-load-init 'new-edit-definitions "find-src") not yet
  (setq comint-fix-error ":pop"
	ilisp-reset ":reset"
	comint-continue ":cont"
	comint-interrupt-regexp  "Error: [^\n]* interrupt\)")
  (setq comint-prompt-status
	(function (lambda (old line)
		    (comint-prompt-status old line 'armedbear-check-prompt))))
  ;; <cl> or package> at top-level
  ;; [0-9c] <cl> or package> in error
  ;; (setq comint-prompt-regexp "^\\(\\[[0-9]*c*\\] \\|\\)\\(<\\|\\)[^>]*> ")
  ;; (setq comint-prompt-regexp "^\\(\\[[0-9]+i?c?\\] \\|\\[step\\]\\)?\\(<?[-A-Za-z]* ?[0-9]*?>\\|[-A-Za-z0-9]+([0-9]+):\\) ")

  ;; Patch by kpc 94/8/30: allow prompts that look like this:
  ;; USER(23): USER(23):
  (setq comint-prompt-regexp "^\\(\\(\\[[0-9]+i?c?\\] \\|\\[step\\] \\)?\\(<?[-A-Za-z]* ?[0-9]*?>\\|[-A-Za-z0-9]+([0-9]+):\\) \\)+")

  (setq ilisp-error-regexp
	"\\(ILISP:[^\"]*\\)\\|\\(Error:[^\n]*\\)\\|\\(Break:[^\n]*\\)")

  (setq ilisp-source-types (append ilisp-source-types '(("any"))))

  ;; [use new protocol.  -- rgr, 24-Mar-03.]
  (setq ilisp-find-source-command "(ilisp::source-file %S %S %S)")


  ;; FI:CLMAN support

  (setf ilisp-*use-fi-clman-interface-p* nil)

  ;; ILD Support

  (setq ild-abort-string ":pop"
	ild-continue-string ":cont"
	ild-next-string ":dn"
	ild-next-string-arg ":dn %s"
	ild-previous-string ":up"
	ild-previous-string-arg ":up %s"
	ild-top-string ":to"
	ild-bottom-string ":bo"
	ild-backtrace-string ":bt"
	ild-locals-string ":local"
	ild-local-string-arg ":local %s"
	ild-return-string nil		;needs work
	ild-retry-string ":rest"
	ild-trap-on-exit-string ":boe")
  )

(unless armedbear-program (setq armedbear-program "abl"))

;;; end of file -- ilisp-armedbear.el --





-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click