From 7f2917d28642cfbdf590ff26f0cdd91a79b1c489 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 22 Sep 2015 11:27:11 +0100 Subject: [PATCH] src/: Yet more naming and export twiddles. * Export `class-item', which names a pluggable parser invoked in parsing class definitions. * Export the accessors for `code-fragment-item' objects. * Rename the `message-*' generic methods to be `sod-message-*', for consistency with the existing accessors. Specific targets are `message-combination', on aggregating messages, and `message-effective-method-class', part of the layout protocol, which is just inconsistent with `sod-message-method-class' in the metaobject construction protocol. * Also export `sod-message-kernel-function', which is used in aggregating messages. * Astonishingly, I'd not exported any of the `vtmsgs' symbols. --- doc/layout.tex | 3 ++- src/class-layout-impl.lisp | 2 +- src/class-layout-proto.lisp | 2 ++ src/method-aggregate.lisp | 11 ++++++----- src/method-impl.lisp | 2 +- src/method-proto.lisp | 8 ++++---- src/module-impl.lisp | 3 ++- src/module-parse.lisp | 2 ++ 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/doc/layout.tex b/doc/layout.tex index c4f095a..688d693 100644 --- a/doc/layout.tex +++ b/doc/layout.tex @@ -215,7 +215,8 @@ \dhead{gf}{effective-method-class @ @> @}} \end{describe*} -\begin{describe}{gf}{message-effective-method-class @ @> @} +\begin{describe}{gf} + {sod-message-effective-method-class @ @> @} \end{describe} \begin{describe}{gf}{primary-method-class @ @> @} diff --git a/src/class-layout-impl.lisp b/src/class-layout-impl.lisp index fb684b7..8f14e1e 100644 --- a/src/class-layout-impl.lisp +++ b/src/class-layout-impl.lisp @@ -118,7 +118,7 @@ :key #'sod-method-message :test-not #'eql)) (sod-class-precedence-list class)))) - (make-instance (message-effective-method-class message) + (make-instance (sod-message-effective-method-class message) :message message :class class :direct-methods direct-methods))) diff --git a/src/class-layout-proto.lisp b/src/class-layout-proto.lisp index 684fb32..bf3bfa4 100644 --- a/src/class-layout-proto.lisp +++ b/src/class-layout-proto.lisp @@ -151,6 +151,8 @@ ;;; vtmsgs +(export '(vtmsgs vtmsgs-class vtmsgs-subclass + vtmsgs-chain-head vtmsgs-chain-tail vtmsgs-entries)) (defclass vtmsgs () ((%class :initarg :class :type sod-class :reader vtmsgs-class) (subclass :initarg :subclass :type sod-class :reader vtmsgs-subclass) diff --git a/src/method-aggregate.lisp b/src/method-aggregate.lisp index e9a889d..bd8fe8a 100644 --- a/src/method-aggregate.lisp +++ b/src/method-aggregate.lisp @@ -28,11 +28,12 @@ ;;;-------------------------------------------------------------------------- ;;; Classes and protocol. -(export '(aggregating-message message-combination)) +(export '(aggregating-message + sod-message-combination sod-message-kernel-function)) (defclass aggregating-message (simple-message) ((combination :initarg :combination :type keyword - :reader message-combination) - (kernel-function :type function :reader message-kernel-function)) + :reader sod-message-combination) + (kernel-function :type function :reader sod-message-kernel-function)) (:documentation "Message class for aggregating method combinations. @@ -105,14 +106,14 @@ (with-slots (combination) message (check-aggregating-message-type message combination type))) -(defmethod message-effective-method-class ((message aggregating-message)) +(defmethod sod-message-effective-method-class ((message aggregating-message)) 'aggregating-effective-method) (defmethod simple-method-body ((method aggregating-effective-method) codegen target) (let ((argument-names (effective-method-basic-argument-names method)) (primary-methods (effective-method-primary-methods method))) - (funcall (message-kernel-function (effective-method-message method)) + (funcall (sod-message-kernel-function (effective-method-message method)) codegen target argument-names primary-methods))) (defmethod shared-initialize :before diff --git a/src/method-impl.lisp b/src/method-impl.lisp index b9543fd..6f6caad 100644 --- a/src/method-impl.lisp +++ b/src/method-impl.lisp @@ -542,7 +542,7 @@ (defmethod primary-method-class ((message standard-message)) 'delegating-direct-method) -(defmethod message-effective-method-class ((message standard-message)) +(defmethod sod-message-effective-method-class ((message standard-message)) 'standard-effective-method) (defmethod simple-method-body diff --git a/src/method-proto.lisp b/src/method-proto.lisp index b4b788d..d176602 100644 --- a/src/method-proto.lisp +++ b/src/method-proto.lisp @@ -47,8 +47,8 @@ order. (Either that or you have to add an overriding method to `compute-sod-effective-method'.")) -(export 'message-effective-method-class) -(defgeneric message-effective-method-class (message) +(export 'sod-message-effective-method-class) +(defgeneric sod-message-effective-method-class (message) (:documentation "Return the effective method class for the given MESSAGE. @@ -67,8 +67,8 @@ "Return the effective method when a CLASS instance receives MESSAGE. The default method constructs an instance of the message's chosen - `message-effective-method-class', passing the MESSAGE, the CLASS and the - list of applicable methods as initargs to `make-instance'.")) + `sod-message-effective-method-class', passing the MESSAGE, the CLASS and + the list of applicable methods as initargs to `make-instance'.")) (export 'compute-effective-methods) (defgeneric compute-effective-methods (class) diff --git a/src/module-impl.lisp b/src/module-impl.lisp index 08679ce..1e1f662 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -196,7 +196,8 @@ (defmethod make-load-form ((fragment c-fragment) &optional environment) (make-load-form-saving-slots fragment :environment environment)) -(export 'code-fragment-item) +(export '(code-fragment-item code-fragment code-fragment-reason + code-fragment-name code-fragment-constraints)) (defclass code-fragment-item () ((fragment :initarg :fragment :type c-fragment :reader code-fragment) (reason :initarg :reason :type keyword :reader code-fragment-reason) diff --git a/src/module-parse.lisp b/src/module-parse.lisp index 9cad3d4..4bf071c 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -167,6 +167,8 @@ ;;;-------------------------------------------------------------------------- ;;; Class declarations. +(export 'class-item) + (defun parse-class-body (scanner pset name supers) ;; class-body ::= `{' class-item* `}' ;; -- 2.11.0