Working interactively in the Red console

Like any dynamic language, Red has a REPL console. The red command without arguments (open or double-click red.bat) starts a graphical window console on Windows and macOS, and a command-line console on Linux. If you need a command-line console on Windows and macOS, just use the command red --cli.

The console is a full Red interpreter and expects the input of Red code after the >> prompt, to evaluate and then execute it when pressing Enter. It's a live interaction with the language. Simply giving it a value (here a string indicated by "") returns that value after the ==:

;-- see Chapter02/console-examples.red:>> "Red is awesome"== "Red is awesome"

(You can find the source code of these examples in ...

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.