[REBOL] best means of passing refinements from main to helper function? Re:(3)
From: jelinem1:nationwide at: 18-Sep-2000 8:35
But then this (the example below) explicitly lists the refinements in the
function body. I think the "ultimate" solution would process an arbitray
list, as with a loop. It is fairly short though :) and IS a step up from
'if statements, esp for more than 2 refinements.
- Michael Jelinek
[jeff--rebol--net] on 09/15/2000 04:04:34 PM
From: [jeff--rebol--net] on 09/15/2000 04:04 PM
Please respond to [list--rebol--com]
Subject: [REBOL] best means of passing refinements from main to helper
The following approach is exactly elegant, but it gets the
job done and it's fairly short. I think it's kind of cute.
deduction: func [
rejoin [ "file-"
either use-month [ month-to-use ] [ now/month ]
either use-day [ day-to-use ] [ now/day ]
main: func [
go?: func ['what /it][either it: get what [either true = it [what][it]]
do reduce compose/deep [to-path [deduction (go? use-month) (go?
(go? month-to-use) (go? day-to-use)]