Skip to Content
Learn Red ? Fundamentals of Red
book

Learn Red ? Fundamentals of Red

by Ivo Balbaert
May 2018
Beginner content levelBeginner
252 pages
6h 19m
English
Packt Publishing
Content preview from Learn Red ? Fundamentals of Red

Word bindings

Within a Red program, several contexts can exist. A context is a scope in which a word can be defined, or as reducers say—a word is bound to a context. For example, within a function context a local word price may be used, and in another function the same word price may have a totally different meaning or value—the word price is used in different contexts.

Other types of contexts are within a block or within the entire script or environment (the global context). For example, if you put in type ? chocolate in the Red console, it prints the following:

No matching values were found in the global context.

Within a context, a word refers to a value, as in these examples:

;-- see Chapter03/bindings.red:age: 62is-integer?: falselunch-time: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

How I Built a Personal Board of Directors With GenAI

How I Built a Personal Board of Directors With GenAI

Vipin Gupta
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally
Why AI Demands a New Breed of Leaders

Why AI Demands a New Breed of Leaders

Faisal Hoque, Thomas Davenport, Erik Nelson

Publisher Resources

ISBN: 9781789130706Supplemental Content