]> gitweb.factorcode.org Git - factor.git/commitdiff
classes.struct: slightly simpler using fry
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Jan 2022 03:12:10 +0000 (19:12 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 18 Jan 2022 03:12:10 +0000 (19:12 -0800)
basis/classes/struct/struct.factor

index 1a4d0460b0ec9b9abea5b3033e11bad14d45c62b..4e8125ea6113f126275749376199fc4076885072 100644 (file)
@@ -204,7 +204,7 @@ M: struct-c-type base-type ;
 
 : struct-equals-quot ( class -- quot )
     dup struct-slots
-    [ name>> reader-word '[ [ _ execute ] same? ] ] map
+    [ name>> reader-word 1quotation '[ [ @ ] same? ] ] map
     '[ over _ instance? [ _ 2&& ] [ 2drop f ] if ] ;
 
 : define-equal-method ( class -- )
@@ -217,8 +217,7 @@ M: struct-c-type base-type ;
     binary-object memory>byte-array ; inline
 
 : define-clone-method ( class -- )
-    [ \ clone ]
-    [ \ clone-underlying swap literalize \ memory>struct [ ] 3sequence ] bi
+    [ \ clone ] [ '[ clone-underlying _ memory>struct ] ] bi
     define-inline-method ;
 
 : forget-clone-method ( class -- )