[racket-dev] #true and #false

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sun Oct 10 11:27:36 EDT 2010

Jay McCarthy wrote at 10/10/2010 10:58 AM:
> So overall I think that #true and #false are good there [in teaching languages] and I don't see any problem with them being available elsewhere... just not the default.

FWIW, I would occasionally like to spell out "#true" and "#false" in my 
code.  Mainly when giving a Boolean value, rather than "#f" as a 
``none'' value; and in something non-cramped, like a default for a 
variable, rather than each value in a matrix.  But for the majority of 
uses I would prefer to write "#f" in my code, and to also see that as 
the printed representation most of the time.

If "#true" and "#false" were just alternative read syntax for "#t" and 
"#f", and they always printed as "#t" and "#f" (except perhaps in 
teaching languages), that would make me happiest.

I think it's not too bad if a new programmer types "#true" in their code 
and later sees the value printed as "#t".  They'll figure it out within 
2 seconds the first time.  (It's a lot more intuitive than how the 
printing of a pair changes when its CDR is another pair or a null.)

-- 
http://www.neilvandyke.org/



Posted on the dev mailing list.