[REBOL] How do I handle an unset! item as a parameter to other words
From: gerardcote:sympatico:ca at: 2-Dec-2002 9:23
Hi everybody,
Since I am trying to get the maximum output from the available ON-LINE help
REBOL offers to me, I ask myself if there is a way to get a file from the
what
function, excepted from the evident way I already tried and tested -
that is by modifying the source of the "what" funct. and redirecting its
output from console (the original funct. uses a PRINT to show every word and
its args) to a file (Write/append/lines %rebol-dict.txt to-string reduce
[word " " args] ).
I looked for something like using the following constructs but I got a
similar error in any case :
>>write %rebol-dict-2.txt what
... a long list of the avail. words and their args follows then ...
** Script Error: write is missing its value argument
** Where: halt-view
** Near: write %rebol-dict-2.txt what
>>
I tried to look why REBOl acts like this with :
>>type? what
... a long list of the avail. words and their args follows then ...
= = unset!
so a function is not available as an entry to another as is.
But is there a way to mislead REBOL as to think this is simply another word
having a regular value to act upon ?
I tried the "set" word but seems I really lack some fundamental knowledge in
this area.
May someone help me please ? I would be much grateful to any submitter who
tries. Thanks in advance.
REBOL surely has to be this DYNAMIC but how can I do it without reinventing
the Wheel everytime ?
Thanks,
Gerard
P.S. From a newcomer's pov, it seems to me that the WHAT function SHOULD
appear in any other on-line HELP related word included with REBOL.
For example, the first time I tried REBOL I would have liked this listed
somewhere, like when a new user types HELP, or USAGE and that some hints are
displayed.
If I didn't discover this command by the way of the ML - I agree that I
should have read and studied every cmd since the beginning from the CORE
User's guide but I didn't read all yet and the letter W is at the end - I
wouldn't know about this before a very long time ...
If this is not added to the on-line REBOL HELP or USAGE commands, be sure to
include it soon in the available docs. May be it is but it didn't took my
attention soon enough and it should have been so, from my pov.
Another suggestion would be to add some options to pause (or otherway
control or redirect) the display of native REBOL words that display very
LONG, multi-pages information to the console.
Much like the way the MS-DOS "DIR" command (or the Unix "ls" command)
permitted to display everything in different ways with simple refinements.
Why should everybody reinvent the wheel for so common use Words ?
Or at least someone should submit a library of functions related to these
common taks. If nobody has done such work, I'll do my best in a near future
while adapting my old knowledge to teach REBOL for newcomers. Then I'll
submit this stuff for common use but it seems this is like bread and butter
in my current tasks and a bit neglected in what native REBOL offers to its
users, even if I understand the footprint has to be the smallset possible -
it's a REAL compromise between productivity, easiness and compactness, but
sometimes for very frequent tasks I personally favor the first 2 ...
Thanks for listening,
Gerard