The has word

To define a simple function that has no arguments but does have local variables that are defined in a block that comes before the code block, use has as follows:

calc-hours-year: has [number] [    number: 365 * 24 ; number is local    print number]   ;== func [/local number][...]calc-hours-year ;== 8760number   ; *** Script Error: number has no value 

The return value of  calc-hours-year shows that it is a function (func) with a local number variable that is not known outside of the function. Another way to look at it is that has turned the words in its first block into local variables.

=>  Now answer question 3 from the Questions section.

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.