[REBOL] Re: problems creating a path
From: antonr:iinet:au at: 4-Jun-2003 13:36
Actually, I couldn't quite use 'pick, unless I converted
the values to logic!s, which went above a threshold of
ease-of-use for me.
> > How to get rid of the brackets?
> compose could help
> to-path compose [
> (pick [files ] files?)
> (pick [folders ] folders?)
I simplified my example a little too much.
The code needed to also accept none as a value in
files? & folders?, not just true & false, because
the values were coming from check boxes and radios
in a window.
Anyway, the best I can do is this:
blk: do reduce [to-path compose [
(either folders-chk/data ['show-folders])
(either files-chk/data ['show-files])
(either images-chk/data ['show-images])
(either abs-rl/data ['absolute-paths])
(either details-chk/data ['details])
I passed through some other alternatives, but this way
seems the best. I was looking for a way that does not
use any extra words, has a small code size, and is easy
to add new refinements.
By chance is there anyone who can do better? I challenge you!
I busted my head on this for some hours.