Commit 5aebbfce authored by sof's avatar sof
Browse files

[project @ 1999-05-04 08:31:51 by sof]

Updated _casm_ example
parent 765a2637
...@@ -17,6 +17,9 @@ computations on small integers. The performance of <tt/Integer/ is now ...@@ -17,6 +17,9 @@ computations on small integers. The performance of <tt/Integer/ is now
only slightly slower than <tt/Int/ for values between <tt/minBound :: Int/ only slightly slower than <tt/Int/ for values between <tt/minBound :: Int/
and <tt/maxBound :: Int/. and <tt/maxBound :: Int/.
<item> On Win32 platforms, added support for using (and producing) dynamic
link libraries (DLLs) containing ghc-compiled code.
<item> Added @-funbox-strict-fields@ for unboxing/unpacking strict <item> Added @-funbox-strict-fields@ for unboxing/unpacking strict
constructor fields. constructor fields.
......
% %
% $Id: glasgow_exts.vsgml,v 1.9 1999/04/29 12:21:50 simonpj Exp $ % $Id: glasgow_exts.vsgml,v 1.10 1999/05/04 08:31:52 sof Exp $
% %
% GHC Language Extensions. % GHC Language Extensions.
% %
...@@ -234,13 +234,16 @@ may be just the ticket (NB: <em>no chance</em> of such code going ...@@ -234,13 +234,16 @@ may be just the ticket (NB: <em>no chance</em> of such code going
through a native-code generator): through a native-code generator):
<tscreen><verb> <tscreen><verb>
import Addr
import CString
oldGetEnv name oldGetEnv name
= _casm_ ``%r = getenv((char *) %0);'' name >>= \ litstring@(A# str#) -> = _casm_ ``%r = getenv((char *) %0);'' name >>= \ litstring ->
return ( return (
if (litstring == ``NULL'') then if (litstring == nullAddr) then
Left ("Fail:oldGetEnv:"++name) Left ("Fail:oldGetEnv:"++name)
else else
Right (unpackCString# str#) Right (unpackCString litstring)
) )
</verb></tscreen> </verb></tscreen>
...@@ -1545,10 +1548,10 @@ assertion was made, ...@@ -1545,10 +1548,10 @@ assertion was made,
assert pred val ==> assertError "Main.hs|15" pred val assert pred val ==> assertError "Main.hs|15" pred val
</verb></tscreen> </verb></tscreen>
The rewrite is only performed by the compiler when applications of The rewrite is only performed by the compiler when it spots
<tt>Exception.assert</tt> are spotted, so you can still define and use applications of <tt>Exception.assert</tt>, so you can still define and
your own versions of <tt/assert/, should you so wish. If not, import use your own versions of <tt/assert/, should you so wish. If not,
<tt/Exception/ to make use <tt/assert/ in your code. import <tt/Exception/ to make use <tt/assert/ in your code.
To have the compiler ignore uses of assert, use the compiler option To have the compiler ignore uses of assert, use the compiler option
@-fignore-asserts@. <nidx>-fignore-asserts option</nidx> That is, @-fignore-asserts@. <nidx>-fignore-asserts option</nidx> That is,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<!ENTITY utils SYSTEM "utils.sgml" > <!ENTITY utils SYSTEM "utils.sgml" >
<!ENTITY mutablearray SYSTEM "MutableArray.sgml"> <!ENTITY mutablearray SYSTEM "MutableArray.sgml">
<!ENTITY bytearray SYSTEM "ByteArray.sgml"> <!ENTITY bytearray SYSTEM "ByteArray.sgml">
<!ENTITY win32-dll SYSTEM "win32-dlls.sgml">
]> ]>
<article> <article>
...@@ -41,5 +42,6 @@ Email: @glasgow-haskell-{bugs,users}-request@@haskell.org@ ...@@ -41,5 +42,6 @@ Email: @glasgow-haskell-{bugs,users}-request@@haskell.org@
&libmisc &libmisc
&wrong &wrong
&utils &utils
&win32-dll
</article> </article>
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