Fixed bug where primitive-type? could not handle "Class*" types

db4
Jeremy Hughes 2009-07-05 21:03:36 +12:00
parent 519277a0a0
commit c32d7c5c97
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Jeremy Hughes.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types assocs combinators.short-circuit fry
kernel memoize sequences splitting ;
USING: alien.c-types assocs combinators.short-circuit
continuations fry kernel memoize sequences splitting ;
IN: alien.inline.types
: factorize-type ( str -- str' )
@ -19,8 +19,10 @@ MEMO: resolved-primitives ( -- seq )
primitive-types [ resolve-typedef ] map ;
: primitive-type? ( type -- ? )
factorize-type resolve-typedef [ resolved-primitives ] dip
'[ _ = ] any? ;
[
factorize-type resolve-typedef [ resolved-primitives ] dip
'[ _ = ] any?
] [ 2drop f ] recover ;
: pointer? ( type -- ? )
[ "*" tail? ] [ "&" tail? ] bi or ;