alien.marshall.types: robustifying

db4
Jeremy Hughes 2009-07-15 16:40:41 +12:00
parent c1ccc6a2b0
commit 30698cc534
1 changed files with 3 additions and 2 deletions

View File

@ -31,12 +31,13 @@ MEMO: resolved-primitives ( -- seq )
] [ 2drop f ] recover ;
: pointer? ( type -- ? )
[ "*" tail? ] [ "&" tail? ] bi or ;
factorize-type [ "*" tail? ] [ "&" tail? ] bi or ;
: type-sans-pointer ( type -- type' )
[ '[ _ = ] "*&" swap any? ] trim-tail ;
factorize-type [ '[ _ = ] "*&" swap any? ] trim-tail ;
: pointer-to-primitive? ( type -- ? )
factorize-type
{ [ pointer? ] [ type-sans-pointer primitive-type? ] } 1&& ;
: types-effect>params-return ( types effect -- params return )