Plaster
New
List
Login
common-lisp
default
anonymous
2022.12.11 13:00:41
;;;; File "capitalized-export-test.lisp" ;;;; ;;;; Testing exporting by capitalizing symbols. (in-package :capitalized-export) (eval-when (:compile-toplevel :load-toplevel :execute) (setf *readtable* (make-capitalized-export-readtable))) (defclass Person () ((%name :initarg :name :accessor Name :initform nil) (%age :initarg :age :accessor Age :initform nil))) ;; |...| is not exported, should instead be exported the normal way. (defun |Make-person| () (make-instance 'person)) (defparameter *circular* '#1=(1 2 3 . #1#)) ;; CAPITALIZED-EXPORT> (do-external-symbols (s) (print s)) ;; NIL ;; CAPITALIZED-EXPORT> (load (compile-file "simple-test.lisp")) ;; ; compiling file "[...]/simple-test.lisp" (written 11 DEC 2022 12:10:59 AM): ;; Before: ;; ;; ((DEFCLASS |Person| NIL ;; ((%NAME :INITARG :NAME :ACCESSOR |Name| :INITFORM NIL) ;; (%AGE :INITARG :AGE :ACCESSOR |Age| :INITFORM NIL))) ;; (DEFUN #(ESCAPE |Make-person|) () (MAKE-INSTANCE 'PERSON)) ;; (DEFPARAMETER *CIRCULAR* '#1=(1 2 3 . #1#))) ;; After: ;; ;; ((DEFCLASS PERSON NIL ;; ((%NAME :INITARG :NAME :ACCESSOR NAME :INITFORM NIL) ;; (%AGE :INITARG :AGE :ACCESSOR AGE :INITFORM NIL))) ;; (DEFUN |Make-person| () (MAKE-INSTANCE 'PERSON)) ;; (DEFPARAMETER *CIRCULAR* '#1=(1 2 3 . #1#)) ;; (EXPORT '(AGE NAME PERSON))) ;; ;; ; wrote [...]/simple-test.fasl ;; ; compilation finished in 0:00:00.011 ;; T ;; CAPITALIZED-EXPORT> (do-external-symbols (s) (print s)) ;; ;; PERSON ;; NAME ;; AGE
Raw
Annotate
Repaste
Edit