This seems to be an occasionally reoccurring topic. In short I don't think
anyone has come up with a simple elegant way of doing this. A few of us
have come up with solutions which involve building the helper-function
call/refinements string. You might find, however, that you would rather use
a bunch of 'if statements.
- Michael Jelinek
[EMAIL PROTECTED]@MailAndNews.com> on 09/15/2000 03:30:03 PM
From: [EMAIL PROTECTED]@MailAndNews.com on 09/15/2000 03:30 PM
Please respond to [EMAIL PROTECTED]
Sent by: Terrence Brannon <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc:
Subject: [REBOL] best means of passing refinements from main to helper
function?
I want to know the best way to propagate refinement selections (or their
lack)
to a function which actually does the processing for them.
deduction: func [/use-month month-to-use /use-day day-to-use] [
rejoin [ "file-"
either use-month [ month-to-use ] [
now/month ]
either use-day [ day-to-use ] [ now/day
]
]
]
main [/use-month month-to-use
/use-day day-to-use
] [
; --- dilemma:
; --- I can call deduction with
; --- a - no refinements
; --- b - either or 1 refinement
; --- c - both refinements
; and I dont want a bunch of hairy eithers and ifs to create
; all the various refinements to send to deduction
]
terrence-brannon: [[EMAIL PROTECTED] perl-refugee myth-gamer]
free-email: http://www.MailAndNews.com
free-usenet: http://www.mailAndNews.com
; all the above is real REBOL code, believe it or not.