@@ -9,22 +9,23 @@ function repr end
99
1010struct DevNull <: IO end
1111const devnull = DevNull ()
12- isreadable (:: DevNull ) = false
13- iswritable (:: DevNull ) = true
14- isopen (:: DevNull ) = true
15- read (:: DevNull , :: Type{UInt8} ) = throw (EOFError ())
1612write (:: DevNull , :: UInt8 ) = 1
1713unsafe_write (:: DevNull , :: Ptr{UInt8} , n:: UInt ):: Int = n
1814close (:: DevNull ) = nothing
19- flush (:: DevNull ) = nothing
20- wait_readnb (:: DevNull ) = wait ()
2115wait_close (:: DevNull ) = wait ()
22- eof (:: DevNull ) = true
2316
2417let CoreIO = Union{Core. CoreSTDOUT, Core. CoreSTDERR}
25- global write, unsafe_write
26- write (io:: CoreIO , x:: UInt8 ) = Core. write (io, x)
27- unsafe_write (io:: CoreIO , x:: Ptr{UInt8} , nb:: UInt ) = Core. unsafe_write (io, x, nb)
18+ global write (io:: CoreIO , x:: UInt8 ) = Core. write (io, x)
19+ global unsafe_write (io:: CoreIO , x:: Ptr{UInt8} , nb:: UInt ) = Core. unsafe_write (io, x, nb)
20+
21+ CoreIO = Union{CoreIO, DevNull}
22+ global read (:: CoreIO , :: Type{UInt8} ) = throw (EOFError ())
23+ global isopen (:: CoreIO ) = true
24+ global isreadable (:: CoreIO ) = false
25+ global iswritable (:: CoreIO ) = true
26+ global flush (:: CoreIO ) = nothing
27+ global eof (:: CoreIO ) = true
28+ global wait_readnb (:: CoreIO , nb:: Int ) = nothing
2829end
2930
3031stdin = devnull
0 commit comments