Script Library: 1240 scripts
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Documentation for: twelvedays.r


Usage document for %twelvedays.r

1. Introduction to %twelvedays.r

twelvedays.r prints out all the lyrics for the popular Christmas song, The Twelve Days of Christmas.

2. twelvedays At a Glance

Not setup is required, just doit.

3. Using %twelvedays.r

3.1. Running %twelvedays.r

Evaluate the script directly out of the rebol.org library with

 >> do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=twelvedays.r
 
or locally with
 >> do %twelvedays.r
 

4. What you can learn

This script is a fair example of information hiding. The Twelve_Days object! encapsulates a function, Sing that also encapsulates another function, Gift. Both of these inner functions make proper use of local variables.

The script only exposes the Twelve_Days object into the global name space. Everything else is hidden within this naming context.

Plus you get to learn the proper lyrics for the Twelve Days of Christmas rhyme.

5. What can break

Nothing to break here.

6. Credits

%twelvedays.r Author: Unknown
Twelve Days of Christmas Rhyme originally in Mirth without Mischief, circa 1780
  • The rebol.org Library Team
  • Usage document by Brian Tiffin, Library Team Apprentice, Last updated: 12-May-2007