From 8d4585edefb2b6a32273af62f8bff9de1dd984ca Mon Sep 17 00:00:00 2001 From: Jeremy Hughes Date: Wed, 22 Jul 2009 19:20:01 +1200 Subject: [PATCH] alien.marshall: tidy unmarshallers --- extra/alien/marshall/marshall.factor | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/alien/marshall/marshall.factor b/extra/alien/marshall/marshall.factor index eec0cadcbb..547e37f78a 100644 --- a/extra/alien/marshall/marshall.factor +++ b/extra/alien/marshall/marshall.factor @@ -275,21 +275,21 @@ ALIAS: marshall-void* marshall-pointer : ?malloc-byte-array ( c-type -- alien ) dup alien? [ malloc-byte-array ] unless ; -:: x-unmarshaller ( type type-quot wrapper-test def clean -- quot/f ) +:: x-unmarshaller ( type type-quot superclass def clean -- quot/f ) type type-quot call current-vocab lookup [ - dup superclasses wrapper-test any? + dup superclasses superclass swap member? [ def call ] [ drop clean call f ] if ] [ clean call f ] if* ; inline : struct-unmarshaller ( type -- quot/f ) - [ ] [ \ struct-wrapper = ] + [ ] \ struct-wrapper [ '[ ?malloc-byte-array _ new swap >>underlying ] ] [ ] x-unmarshaller ; : class-unmarshaller ( type -- quot/f ) - [ type-sans-pointer ] [ \ alien-wrapper = ] - [ '[ ?malloc-byte-array _ new swap >>underlying ] ] + [ type-sans-pointer "#" append ] \ class-wrapper + [ '[ _ new swap >>underlying ] ] [ ] x-unmarshaller ;