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

db4
John Benediktsson 2012-07-31 22:03:06 -07:00
parent 17edc5e63a
commit 7b7df45c50
1 changed files with 6 additions and 2 deletions
basis/alien/libraries

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