Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: getting and passing a function's CURRENT arg block

From: antonr:iinet:au at: 17-Nov-2003 14:14

13 refinements seems excessive to me, but anyway I know this thorny problem. Which native are you wrapping? I suggest building a path to the native.
>From an old thread in June with subject: "Re: problems creating a path",
I grabbed the flag-val function: flag-val: func [flag val][either flag [val][]] to-path compose [hello (flag-val none 'there) (flag-val true 'someone)] ;== hello/someone Let's wrap the layout function as an example: my-layout: func [ specs /size pane-size /offset where ][ do probe compose [ (to-path compose [ layout (flag-val size 'size) (flag-val offset 'offset) ]) (reduce [specs]) (flag-val size pane-size) (flag-val offset where) ] ] ; test view my-layout [box green] ; no refinements view my-layout/size [box green] 90x90 ; one refinement view my-layout/offset [box green] 190x190 ; the other refinement view my-layout/size/offset [box green] 90x90 190x190 ; both refinements view my-layout/offset/size [box green] 190x190 90x90 ; order reversed Anton.