REBOL Technologies

Small change, better HELP.

Carl Sassenrath, CTO
REBOL Technologies
25-Mar-2009 17:00 GMT

Article #0404
Main page || Index || Prior Article [0403] || Next Article [0405] || 11 Comments || Send feedback

Yesterday, I noticed a ticket in CureCode (for R3) that the embedded help system should do a better job helping users. This morning I woke up much too early, and that comment was still on my mind.

IMHO, better help helps all of us -- beginners and experts -- and it does not take much effort.

Since I was obviously awake in the Iceland timezone, I wrote a quick modification to help for something long needed, long wanted: search all embedded help strings and values (not just words).

As you know, help will broaden a search if you use quotes.

Compare:

>> help insert
USAGE:
   INSERT series value /part range /only /dup count

DESCRIPTION:
    Inserts a value into a series and returns the series after the insert.
    INSERT is an action value.

with:

>> help "insert"
Found these words:
  insert          action!   Inserts a value into a series and returns the

It looks for all words that contain "insert". Not much found. What about a function like append the shortcut for insert at tail? It's not listed.

A few lines of REBOL code in R3 made the search a lot better. Now, here's what you see:

>> help "insert"
Found these words:
  append          action!   Inserts a value at tail of series and returns...
  collect         function! Evaluates a block, storing values via KEEP fu...
  compose         native!   Evaluates a block of expressions, only evalua...
  extract         function! Extracts a value from a series at regular int...
  insert          action!   Inserts into a series and returns the series ...
  reword          function! Substitutes values into a template string, re...

That looks a lot better.

Another test:

>> help "remove"
Found these words:
  alter           function! If a value is not found in a series, append i...
  clear           action!   Removes all values from the current index to ...
  input           function! Inputs a string from the console. New-line ch...
  remove          action!   Removes value(s) from a series and returns af...
  remove-each     native!   Removes values for each block that returns tr...
  take            action!   Copies and removes from series. (Modifies)
  trim            action!   Removes space from a string or NONE from a bl...
  undirize        function! Returns a copy of the path with any trailing ...
  unhandle-events function! Removes a handler from the view event system.
  unique          native!   Returns the data set with duplicates removed.

So, now we're seeing many more functions that remove from a series. Functions like clear, take, and trim are good to know.

So, let's try a non-function name:

>> help "series"
(long list of series related functions)

>> help "series!"
(smaller list of the main series functions)

Useful.

Oh, and while I was there I added:

help/doc insert

The /doc refinement means open my web browser to that documentation page. Simple stuff, but a time saver.

Very good. These changes will be included in R3-A39. I hope you find them useful.

Next it would be nice to search by argument datatypes. For example, show me all functions that accept a string argument. If you've got some clean tight code for that, send it to me!

11 Comments

Updated 9-Mar-2024   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code