changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / examples/clos/fast.lisp

changeset 44: 99d4ab4f8d53
parent: 6b652d7d6663
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 11 Aug 2024 01:50:18 -0400
permissions: -rw-r--r--
description: update
1 (in-package :examples/clos/fast)
2 
3 ;; (defclass foo (obj/meta/sealed:sealable-class)
4 ;; ((n :initform 0 :type fixnum :accessor foo-n)))
5 
6 ;; (defmethod binary-+ ((x foo) (y foo))
7 ;; (+ (foo-n x) (foo-n y)))
8 
9 (defmethod binary-+ ((x fixnum) (y fixnum))
10  (declare (method-properties inlineable))
11  (+ x y))
12 
13 (seal-domain #'binary-+ '(t t))
14 (binary-+ 0 0)
15