]> gitweb.factorcode.org Git - factor.git/blobdiff - core/slots/slots.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / core / slots / slots.factor
index e2d75d636243a546f44c65031ccbf48bc8650b19..3cf9b261dca4d3dab54f663b749e4f9bfbf7a0dc 100755 (executable)
@@ -168,6 +168,7 @@ M: class initial-value* no-initial-value ;
     {
         { [ \ f bootstrap-word over class<= ] [ f ] }
         { [ \ array-capacity bootstrap-word over class<= ] [ 0 ] }
+        { [ dup \ integer bootstrap-word class<= ] [ 0 ] }
         { [ float bootstrap-word over class<= ] [ 0.0 ] }
         { [ string bootstrap-word over class<= ] [ "" ] }
         { [ array bootstrap-word over class<= ] [ { } ] }
@@ -233,5 +234,8 @@ M: slot-spec make-slot
 : finalize-slots ( specs base -- specs )
     over length iota [ + ] with map [ >>offset ] 2map ;
 
+: slot-named* ( name specs -- offset spec/f )
+    [ name>> = ] with find ;
+
 : slot-named ( name specs -- spec/f )
-    [ name>> = ] with find nip ;
+    slot-named* nip ;