Commit fb51d8a4 authored by panne's avatar panne
Browse files

[project @ 2000-06-12 18:15:18 by panne]

Use "foreign label" instead of litlit for stdout.
parent 92a2a3c2
......@@ -3,6 +3,7 @@
module Main ( main ) where
import PrelBase
import PrelAddr(indexAddrOffAddr)
import ST
import IOExts
import ST
......@@ -27,13 +28,18 @@ main = putStr
-- Arr# Char# -------------------------------------------
-- (main effort is in packString#)
foreign label "stdout" addrOfStdout :: Addr
stdout :: Addr
stdout = indexAddrOffAddr addrOfStdout 0
test_chars :: String
test_chars
= let str = reverse "Now is the time for all good men to come to...\n"
in
unsafePerformIO (
_ccall_ fprintf (``stdout''::Addr) (packString "%d %s\n") (93::Int) (packString str) >>
_ccall_ fflush (``stdout''::Addr) >>
_ccall_ fprintf stdout (packString "%d %s\n") (93::Int) (packString str) >>
_ccall_ fflush stdout >>
return ""
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment