]> gitweb.factorcode.org Git - factor.git/commitdiff
Small cleanups
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 15 Feb 2010 15:04:09 +0000 (04:04 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 15 Feb 2010 15:04:09 +0000 (04:04 +1300)
basis/io/backend/unix/unix.factor
basis/io/directories/unix/linux/linux.factor
basis/io/styles/styles.factor
basis/math/bitwise/bitwise.factor
basis/prettyprint/stylesheet/stylesheet.factor

index 1797edccf61b8e4e9564bce0466bddb46ff382ad..39f0a5fec381bd1d2e2bebfbc41a0017ce74bcee 100644 (file)
@@ -22,10 +22,6 @@ TUPLE: fd < disposable fd ;
     ] with-destructors ;
 
 : <fd> ( n -- fd )
-    #! We drop the error code rather than calling io-error,
-    #! since on OS X 10.3, this operation fails from init-io
-    #! when running the Factor.app (presumably because fd 0 and
-    #! 1 are closed).
     fd new-disposable swap >>fd ;
 
 M: fd dispose
@@ -197,5 +193,5 @@ TUPLE: mx-port < port mx ;
         [ drop 0 ] [ (io-error) ] if
     ] when ;
 
-: ?flag ( n mask symbol -- n )
-    pick rot bitand 0 > [ , ] [ drop ] if ;
+:: ?flag ( n mask symbol -- n )
+    n mask bitand 0 > [ symbol , ] when n ;
index 932cbe230b85262286ca34185c5e8ed7c0125314..3d69c5f8908b8d874cb7aa3c92bb7e5d39fa844d 100644 (file)
@@ -4,7 +4,7 @@ USING: alien.c-types io.directories.unix kernel system unix
 classes.struct unix.ffi ;
 IN: io.directories.unix.linux
 
-M: unix find-next-file ( DIR* -- dirent )
+M: linux find-next-file ( DIR* -- dirent )
     dirent <struct>
     f <void*>
     [ [ readdir64_r ] unix-system-call 0 = [ (io-error) ] unless ] 2keep
index ae493be8490c26f97c741246ece4a79625d30663..d4e1d2c557a4df20e7382a0a7c2be2b3c79fc690 100644 (file)
@@ -163,9 +163,3 @@ M: input summary
 : write-object ( str obj -- ) presented associate format ;
 
 : write-image ( image -- ) [ "" ] dip image associate format ;
-
-SYMBOL: stack-effect-style
-H{
-    { foreground COLOR: FactorDarkGreen }
-    { font-style plain }
-} stack-effect-style set-global
index 204f2959447ac0e1e7ef4a56d99620f2abc1935c..6b301fa97bf071ca3eae841c015a5d12355bbead 100644 (file)
@@ -99,7 +99,7 @@ M: bignum (bit-count)
     ] if ;
 
 : byte-array-bit-count ( byte-array -- n )
-    0 [ byte-bit-count + ] reduce ;
+    0 [ byte-bit-count + ] reduce ; inline
 
 PRIVATE>
 
index 42a701d60f6639ad5e5068433a2b20fe70efaf85..bd25438b7499beea450244f356bdac0d133c06f1 100644 (file)
@@ -42,5 +42,12 @@ PRIVATE>
 : vocab-style ( vocab -- style )
     dim-color colored-presentation-style ;
 
+SYMBOL: stack-effect-style
+
+H{
+    { foreground COLOR: FactorDarkGreen }
+    { font-style plain }
+} stack-effect-style set-global
+
 : effect-style ( effect -- style )
     presented associate stack-effect-style get assoc-union ;