From: Mark Wooding Date: Sun, 26 Mar 2017 14:16:18 +0000 (+0100) Subject: src/class-finalize-impl.lisp (clos-cpl, dylan-cpl): Improve formatting. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/5d55bdaafab11f2479024bcd1cf5d76e0cf73f98 src/class-finalize-impl.lisp (clos-cpl, dylan-cpl): Improve formatting. * In `clos-cpl', distinguish the `class' argument to the outer function from the lambda-bound `c'. This makes the lambda short enough to un-miser the `merge-class-lists' call. * in `dylan-cpl', hoist the `cpls' calculation into the `let', to match `c3-cpl' below. Again, this lets us un-miser. --- diff --git a/src/class-finalize-impl.lisp b/src/class-finalize-impl.lisp index 6be6b49..7b32406 100644 --- a/src/class-finalize-impl.lisp +++ b/src/class-finalize-impl.lisp @@ -125,11 +125,10 @@ (defun clos-cpl (class) (remove-duplicates (cons class (mappend #'superclasses direct-supers)))))) - (merge-class-lists - (mapcar (lambda (class) - (cons class (sod-class-direct-superclasses class))) - (superclasses class)) - #'clos-tiebreaker))) + (merge-class-lists (mapcar (lambda (c) + (cons c (sod-class-direct-superclasses c))) + (superclasses class)) + #'clos-tiebreaker))) (export 'dylan-cpl) (defun dylan-cpl (class) @@ -150,11 +149,10 @@ (defun dylan-cpl (class) assuming that the superclass CPLs are already monotonic. If they aren't, you're going to lose anyway." - (let ((direct-supers (sod-class-direct-superclasses class))) - (merge-class-lists - (cons (cons class direct-supers) - (mapcar #'sod-class-precedence-list direct-supers)) - #'clos-tiebreaker))) + (let* ((direct-supers (sod-class-direct-superclasses class)) + (cpls (mapcar #'sod-class-precedence-list direct-supers))) + (merge-class-lists (cons (cons class direct-supers) cpls) + #'clos-tiebreaker))) (export 'c3-cpl) (defun c3-cpl (class)