REBOL Programming/Design Guide/Use words not strings

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

A common mistake of beginners is to use text strings to dynamically compose code and data.

This is unnecessary, inefficient, and does not maintain the context of words appropriately.

All dynamic code and data can be composed directly with words, blocks, and data values.

This is also the best way to experience the power of REBOL dialecting.

For example:

days-in-month: [
  January 31 February 28 March 31 
  April 30 May 31 June 30 
  July 31 August 31 September 30 
  October 31 November 30 December 31
print days-in-month/November
print days-in-month/March