Now we come back to the powerful introspective and metaprogramming features of Red—namely, how Red can work with code in the same way as data.
Code is data and data is code
Using reflection on functions
Functions are first-class objects in Red. You can give your own functions, or even built-in ones, another name, as shown here:
;-- see Chapter06/reflection-functions.red:
pr: :print ;== make native! [[
pr ["Hello" "Red"] ;== Hello Red
The : prevents the function from executing; pr: get 'print does the same thing.
This shows Red's flexibility and power; not only changing the name, but even changing the meaning of built-in words is possible. As always, with great power comes...