跳轉到內容

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)
華夏公益教科書