Paste: MACRO: used wrong...

Author: rswarbrick
Mode: factor
Date: Sat, 10 Jan 2009 23:35:01
Plain Text |
MACRO: make-string-list-getter ( name -- )
    [ [ create-in ]
      [ '[ 0 <ulong> tuck "void*" "libMagickWand" _ { "char*" "ulong*" } alien-invoke ] ]
      bi define
    ] curry ;

"MagickQueryConfigureOptions" make-string-list-getter

: MagickQueryConfigureOptions ( pattern -- p-num-options stringlist )
    0 <ulong> tuck "void*" "libMagickWand" "MagickQueryConfigureOptions"
    { "char*" "ulong*" } alien-invoke ;

Annotation: Take 2

Author: rswarbrick
Mode: factor
Date: Sat, 10 Jan 2009 23:49:43
Plain Text |
: SLFunc:
    CREATE-WORD
    word
    '[ 0 <ulong> tuck "void*" "libMagickWand" _ { "char*" "ulong*" } alien-invoke ]
    define ;

Annotation: Take 3

Author: rswarbrick
Mode: factor
Date: Sun, 11 Jan 2009 00:07:07
Plain Text |
! This works, but since it isn't optimised, alien-invoke doesn't work.

: SLFunc:
    CREATE-WORD dup
    '[ 0 <ulong>
       [ "void*" "libMagickWand" _ { "char*" "ulong*" } alien-invoke ] keep
    ]
    define ; parsing

! Trying to declare effect

: SLFunc:
    CREATE-WORD dup
    '[ 0 <ulong>
       [ "void*" "libMagickWand" _ { "char*" "ulong*" } alien-invoke ] keep
    ]
    (( pattern -- pnum plist ))
    define-declared ; parsing

New Annotation

Summary:
Author:
Mode:
Body: