 : pointer-unmarshaller ( type -- quot )
     type-sans-pointer current-vocab lookup [
         dup superclasses [ \ alien-wrapper = ] any? [
-            '[ _ new swap >>underlying dynamic-cast ]
+            '[ _ new swap >>underlying unmarshall-cast ]
         ] [ drop [ ] ] if
     ] [ [ ] ] if* ;
 

    [ (marshall-char*-or-string) ] ptr-pass-through ;

: (marshall-char**-or-strings) ( seq -- alien )
    dup first string?
    [ utf8 strings>alien malloc-byte-array ]
    [ (marshall-char**) ] if ;

: marshall-char**-or-strings ( n/string -- alien )
    [ (marshall-char**-or-strings) ] ptr-pass-through ;

: marshall-bool ( ? -- n )

        { [ dup struct-array? ] [ underlying>> ] }
    } cond ;

: marshall-primitive ( n -- n )
    [ bool>arg ] ptr-pass-through ;

ALIAS: marshall-void* marshall-pointer

: marshall-void** ( seq -- alien )
    [ marshall-void* ] void*-array{ } map-as malloc-underlying ;

: (marshall-char*-or-string) ( n/string -- alien )
    dup string?
