] 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
[ 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 ;
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
: 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
] if ;
: byte-array-bit-count ( byte-array -- n )
- 0 [ byte-bit-count + ] reduce ;
+ 0 [ byte-bit-count + ] reduce ; inline
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 ;