alien.libraries: allow "foo f address-of" to be folded.

John Benediktsson 2012-07-31 22:03:06 -07:00
parent c3a4efdcf1
commit 96c7a59ad2
1 changed files with 6 additions and 2 deletions

View File

@ -56,8 +56,12 @@ M: library dispose dll>> [ dispose ] when* ;
ERROR: no-such-symbol name library ;
: address-of ( name library -- value )
2dup load-library dlsym-raw [ 2nip ] [ no-such-symbol ] if* ;
: (address-of) ( name -- value )
dup f dlsym-raw [ nip ] [ f no-such-symbol ] if* ; foldable
: address-of ( name library/f -- value )
[ 2dup load-library dlsym-raw [ 2nip ] [ no-such-symbol ] if* ]
[ (address-of) ] if* ; inline
SYMBOL: deploy-libraries