Made factorize-type and cify-type public

db4
Jeremy Hughes 2009-07-04 15:23:11 +12:00
parent 3cd4bd8106
commit 284ef4f048
1 changed files with 8 additions and 8 deletions
basis/alien/inline

View File

@ -7,6 +7,14 @@ math.order math.ranges multiline namespaces sequences splitting
strings system vocabs.loader vocabs.parser words ;
IN: alien.inline
: factorize-type ( str -- str' )
"const-" ?head drop
"unsigned-" ?head [ "u" prepend ] when
"long-" ?head [ "long" prepend ] when ;
: cify-type ( str -- str' )
{ { CHAR: ~ CHAR: space } } substitute ;
<PRIVATE
SYMBOL: c-library
SYMBOL: library-is-c++
@ -34,14 +42,6 @@ SYMBOL: c-strings
CHAR: a swap length CHAR: a + [a,b]
[ 1string ] map ;
: factorize-type ( str -- str' )
"const-" ?head drop
"unsigned-" ?head [ "u" prepend ] when
"long-" ?head [ "long" prepend ] when ;
: cify-type ( str -- str' )
{ { CHAR: - CHAR: space } } substitute ;
: factor-function ( function types effect -- word quot effect )
annotate-effect [ c-library get ] 3dip
[ [ factorize-type ] map ] dip