2
red>> red
== true
red>> type? red
== logic!

Just curious to know why is red a boolean variable?

(perhaps unrelated) Side note: rebol in REBOL 2.7 console is of type object!.

Barmar
  • 741,623
  • 53
  • 500
  • 612
RAbraham
  • 5,956
  • 8
  • 45
  • 80

2 Answers2

4

This is no longer the case:

red>> red
== 255.0.0

red>> Red
== 255.0.0
Geeky I
  • 751
  • 6
  • 22
3

It is defined in the "Red base environment definitions" file as

Red: true ;-- ultimate Truth ;-) (pre-defines Red word)

https://github.com/red/red/blob/9c355efa76ac1b5c17a8cbf359c5d7ab05a6a013/environment/scalars.red#L13

This file contains other initial environment definitions such as:

escape:      #"^["
slash:       #"/"
sp: space:   #" "
...

As @kealist points out in the comment below, it serves a useful purpose:

It stops the Red [] header in scripts from causing an error.

In Rebol, the rebol word is bound to the system object so I expect the Red will follow a similar approach.

johnk
  • 1,102
  • 7
  • 12