跳转到内容

Rebol 编程/设计指南/嵌入文档

来自维基教科书,面向开放世界的开放书籍

通过将文档嵌入代码中来保持文档与代码的同步。

Rebol 在设计时考虑到了这一原则。

函数参数块可用于解释函数的目的、其参数和细分。

HELP 将自动使用此信息。

示例

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
 ]
  days/month
]


>>  help days-in-month
USAGE:
   DAYS-IN-MONTH month
DESCRIPTION:
    Returns number of days in a month
    DAYS-IN-MONTH is a function value.
ARGUMENTS:
    month -- Month of the year (Type: word)
华夏公益教科书