Discussion:
A value for "nothing"
HiPhish
2018-09-13 21:49:10 UTC
Permalink
After taking the advice from the mailing list users this is what I have come
up with:

(define-module (msgpack nil)
#:use-module ((srfi srfi-9) #:select (define-record-type))
#:export (nil? (get-nil . nil)))

(define-record-type nil
(make-nil) ; The raw constructor will not get exported
nil?)

(define get-nil ; This will be renamed on export
(let ((the-nil (make-nil))) ; Singleton instance
(λ ()
"- Scheme procedure: nil
Return the unique object representing nothingness in MessagePack.

All calls to this procedure return objects which are 'eq?' to each
other."
the-nil)))

The procedure `get-nil` gets exported as `nil` and returns a singleton
instance of my `nil` type. This way `(eq? (nil) (nil))` is always `#t`. The
only issues is that the `nil?` predicate collides with Guile's own `nil?`
predicate, so users will have to prefix or rename it when importing. I would
prefer not to export these two procedures with prefixes like `msgpack-nil` out
of the box, it's really ugly :/ What is the difference between `nil?` and
`null?` anyway? The former is not listed in the procedure index of the Guile
manual.

What do you think?
HiPhish
2018-09-14 22:45:11 UTC
Permalink
1) Huh, I didn't think this would work because the record type is already nil,
but apparently it does. Good to know

2) `null` is bad because the predicate would be `null?`, which collides even
worse with Scheme. Any other suggestions? `nothing`? `nul` with one ell? I
think it would be too easy for people to miss that one letter and be confused
why things don't work as they should. The MessagePack spec calls the type
`nil`:
https://github.com/msgpack/msgpack/blob/master/spec.md#nil-format
1) Some Schemes don't support rename on export. Just give the procedure
the name you want it to have.
2) Please don't use nil as a name. Many Schemers pronounce (), the
external representation of the empty list, as "nil". Use null or something
else.
John Cowan
2018-09-15 00:26:25 UTC
Permalink
You're right about null? being a problem. `Nothing` suggests an option
type. What about 'nada' or 'nix'?
Post by HiPhish
1) Huh, I didn't think this would work because the record type is already nil,
but apparently it does. Good to know
2) `null` is bad because the predicate would be `null?`, which collides even
worse with Scheme. Any other suggestions? `nothing`? `nul` with one ell? I
think it would be too easy for people to miss that one letter and be confused
why things don't work as they should. The MessagePack spec calls the type
https://github.com/msgpack/msgpack/blob/master/spec.md#nil-format
1) Some Schemes don't support rename on export. Just give the procedure
the name you want it to have.
2) Please don't use nil as a name. Many Schemers pronounce (), the
external representation of the empty list, as "nil". Use null or
something
else.
HiPhish
2018-09-15 14:50:23 UTC
Permalink
Not a fan of either, "nada" is not English, and "nix" is a slang term,
unlikely to be known to foreign speakers (I didn't know about it myself). How
about "nihil", it's an inter-lingual term and close to "nil" in sound.
Post by John Cowan
You're right about null? being a problem. `Nothing` suggests an option
type. What about 'nada' or 'nix'?
David Pirotte
2018-09-15 22:45:28 UTC
Permalink
Post by John Cowan
You're right about null? being a problem. `Nothing` suggests an option
type. What about 'nada' or 'nix'?
I'd call it

tinn
this is not nothing

or

tin
this is nothing

[ and tin, apart from the chemical, has a few of its meaning associated
[ with the function of a 'container' (tin can, tin box ...)

but we'd loose the fun

Keith Wright
2018-09-15 18:28:59 UTC
Permalink
Post by HiPhish
Not a fan of either, "nada" is not English, and "nix" is a slang term,
unlikely to be known to foreign speakers (I didn't know about it myself). How
about "nihil", it's an inter-lingual term and close to "nil" in sound.
none?
Edwin Watkeys
2018-09-15 21:50:48 UTC
Permalink
In previous work on validated systems in pharma manufacturing monitoring settings, there’s the concept of not available (“NAV”) for measurements which is used in contrast to not applicable (“NA”). We never used null/nil but always one of the above when describing measurements.

Edwin Watkeys; 917-324-2435.
Post by HiPhish
Not a fan of either, "nada" is not English, and "nix" is a slang term,
unlikely to be known to foreign speakers (I didn't know about it myself). How
about "nihil", it's an inter-lingual term and close to "nil" in sound.
none?
Edwin Watkeys
2018-09-15 22:23:07 UTC
Permalink
Yes, in a way. A measurement is NA if it is not applicable e.g. a color does not have a mass, whereas NAV is used in contexts where there is a relevant value but it was not retrieved, was lost, was recorded but is indecipherable, was recorded but was corrupted, was recorded but was eaten by the dog, or some similar reason.

The philosopher in me would say NA is an ontological nothingness whereas NAV is an epistemological nothingness.

Edwin Watkeys; 917-324-2435.
"Not available" makes it sound like there something we cannot get a hold of.
Like you have a bag, but the contents of the bag are stuck to it, whereas
"nothing" makes me think of a bag that's actually empty.
Post by Edwin Watkeys
In previous work on validated systems in pharma manufacturing monitoring
settings, there’s the concept of not available (“NAV”) for measurements
which is used in contrast to not applicable (“NA”). We never used null/nil
but always one of the above when describing measurements.
Edwin Watkeys; 917-324-2435.
HiPhish
2018-09-15 22:13:43 UTC
Permalink
That raises to connotation that there can be multiple of something: none, one,
many. Maybe "nothing" really is the best option. After all, "nihil" is just
Latin for "nothing", so I might as well use English.
none?
Loading...