Rebol Programming/Design Guide/Embed your documentation

From Wikibooks, open books for an open world
< Rebol Programming‎ | Design Guide
Jump to navigation Jump to search

Keep your documentation in sync with your code by embedding documentation in your code.

Rebol was designed with this principle in mind.

Function argument blocks can be used to explain the purpose of the function, its arguments, and refinements.

HELP will automatically use this information.


days-in-month: func [
{Returns number of days in a month}
month [ word!]
{Month of the year}
] [
 days: [
  January 31 February 28 March 31 
  April 30 May 31 June 30 
  July 31 August 31 September 30 
  October 31 November 30 December 31

>>  help days-in-month
   DAYS-IN-MONTH month
    Returns number of days in a month
    DAYS-IN-MONTH is a function value.
    month -- Month of the year (Type: word)