Email list hosting service & mailing list manager

Informal proposal: a null value for Scheme Daphne Preston-Kendal (18 Feb 2022 15:08 UTC)
Re: Informal proposal: a null value for Scheme John Cowan (18 Feb 2022 15:35 UTC)
Re: Informal proposal: a null value for Scheme Ray Dillinger (18 Feb 2022 17:52 UTC)
Re: Informal proposal: a null value for Scheme Marc Nieper-Wißkirchen (19 Feb 2022 11:15 UTC)
Re: Informal proposal: a null value for Scheme Per Bothner (18 Feb 2022 17:12 UTC)

Re: Informal proposal: a null value for Scheme Per Bothner 18 Feb 2022 17:11 UTC

On 2/18/22 07:07, Daphne Preston-Kendal wrote:
> I therefore propose adding a special constant to Scheme to represent null, specifically for use at the boundaries between Scheme and other programming systems which distinguish this extra value. Note that these use cases are very distinctly different to those of the Maybe type of SRFI 189.

FWIW, Kawa has a #!null value, which is the null pointer value in the Java VM.
It is considered false:
   (if #!null 'T 'F) => 'F

However:  (null? #!null) => #f which is unfortunate.
I had considered making #!null also be the empty list, but there are some
problems/complications, including that the empty list is supposed to be true.
Making #!null be a true value, and unifying #!null with the empty list would
have been an alternative, though that has some problems, too.  It would
work better in Common Lisp, where the empty list and false are the same.

Kawa also has the literal form #!eof, which is the same as the result of (eof-object).
If in the REPL you type a literal #!eof (but not a quoted #!eof), the REPL exits.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/