X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/7b78999c5e8c9e3f06f6ad565dbafcb676747249..16f9fb7227bf77da748dd6fc03e58c6a9e84ab70:/src/method-aggregate.lisp diff --git a/src/method-aggregate.lisp b/src/method-aggregate.lisp index 9d0a6dd..e9a889d 100644 --- a/src/method-aggregate.lisp +++ b/src/method-aggregate.lisp @@ -28,7 +28,7 @@ (cl:in-package #:sod) ;;;-------------------------------------------------------------------------- ;;; Classes and protocol. -(export 'aggregating-message) +(export '(aggregating-message message-combination)) (defclass aggregating-message (simple-message) ((combination :initarg :combination :type keyword :reader message-combination) @@ -406,18 +406,21 @@ (defmethod aggregating-message-properties :before :fragment :first :fragment :each :fragment - :after :fragment)) + :after :fragment + :count :id)) (defmethod compute-aggregating-message-kernel ((message aggregating-message) (combination (eql :custom)) codegen target methods arg-names &key (retvar "sod_ret") (valvar "sod_val") - decls before each (first each) after) + decls before each (first each) after count) (let* ((type (c-type-subtype (sod-message-type message))) (not-void-p (not (eq type c-type-void)))) (when not-void-p (ensure-var codegen retvar type) (ensure-var codegen valvar type)) + (when count + (ensure-var codegen count c-type-int (length methods))) (when decls (emit-decl codegen decls)) (labels ((maybe-emit (fragment)