Re: A value for "nothing"

2018-09-15 Thread David Pirotte
> 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 [

Re: A value for "nothing"

2018-09-15 Thread HiPhish
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?

Re: A value for "nothing"

2018-09-15 Thread HiPhish
"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. Edwin Watkeys wrote: > In previous work on validated systems in pharma manufacturing mon

Re: A value for "nothing"

2018-09-15 Thread Edwin Watkeys
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

Re: A value for "nothing"

2018-09-15 Thread 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; 91

Re: A value for "nothing"

2018-09-15 Thread Keith Wright
HiPhish writes: > 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?

Re: A value for "nothing"

2018-09-15 Thread 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. you wrote: > You're right about null? being a problem. `Nothing` suggests a

Re: A value for "nothing"

2018-09-14 Thread John Cowan
You're right about null? being a problem. `Nothing` suggests an option type. What about 'nada' or 'nix'? On Fri, Sep 14, 2018 at 6:45 PM HiPhish wrote: > 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

Re: A value for "nothing"

2018-09-14 Thread 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

Re: A value for "nothing"

2018-09-13 Thread HiPhish
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 w

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Hi John, John Cowan writes: > On Tue, Aug 28, 2018 at 11:40 AM Mark H Weaver wrote: > > That's the phrase used in R7RS-small, which fails to define it, as you > noted, but that shortcoming is limited to R7RS. > > The relevant sentences in R5RS and R7RS are identical: " If > yields a false

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
John Cowan writes: > On Tue, Aug 28, 2018 at 11:40 AM Mark H Weaver wrote: > > That's the phrase used in R7RS-small, which fails to define it, as you > noted, but that shortcoming is limited to R7RS. > > The relevant sentences in R5RS and R7RS are identical: " If > yields a false value and

Re: A value for "nothing"

2018-08-28 Thread John Cowan
On Tue, Aug 28, 2018 at 11:40 AM Mark H Weaver wrote: > That's the phrase used in R7RS-small, which fails to define it, as you > noted, but that shortcoming is limited to R7RS. > The relevant sentences in R5RS and R7RS are identical: " If yields a false value and no is specified, then the re

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Mark H Weaver writes: > John Cowan writes: > >> On Tue, Aug 28, 2018 at 3:01 AM Mark H Weaver wrote: >> >> In RnRS, (define a (if #f #f)) is allowed and guaranteed to assign >> *some* object to 'a' without signalling an error. >> >> Actually, the phrase used is "the result is unspecified"

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
John Cowan writes: > On Tue, Aug 28, 2018 at 3:01 AM Mark H Weaver wrote: > > In RnRS, (define a (if #f #f)) is allowed and guaranteed to assign > *some* object to 'a' without signalling an error. > > Actually, the phrase used is "the result is unspecified", which unfortunately > is not de

Re: A value for "nothing"

2018-08-28 Thread John Cowan
On Tue, Aug 28, 2018 at 3:01 AM Mark H Weaver wrote: > In RnRS, (define a (if #f #f)) is allowed and guaranteed to assign > *some* object to 'a' without signalling an error. Actually, the phrase used is "the result is unspecified", which unfortunately is not defined in any RnRS. Racket produc

Re: A value for "nothing"

2018-08-28 Thread Ludovic Courtès
Hello, Mark H Weaver skribis: > l...@gnu.org (Ludovic Courtès) writes: > >> I would suggesting returning zero values, using: >> >> (values) >> >> That way, if a caller wrongfully attempts to get at the return value of >> that procedure, it’ll get an error. >> >> Fibers does that in several pla

Re: A value for "nothing"

2018-08-28 Thread Mark H Weaver
Matt Wette writes: > Is it reasonable to expect that if a value can be assigned to a variable > then a predicate exists to test for that value type? So, if > > (define a (if #f #f)) > > does not signal an error then there should be a predicate to indicate the > value associated with a is unspe

Re: A value for "nothing"

2018-08-27 Thread Matt Wette
Is it reasonable to expect that if a value can be assigned to a variable then a predicate exists to test for that value type? So, if (define a (if #f #f)) does not signal an error then there should be a predicate to indicate the value associated with a is unspecified? If the define allowed i

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > However, in formats like JSON where map keys are always strings, > it can save a lot of space to represent them as symbols, since > they are often repeated from one object to the next. There is no such > limitation in MessagePack, although I bet strings are the most common >

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
John Cowan writes: > On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver wrote: > > However, in most cases, symbols are precisely what's needed to represent > distinguished atomic objects such as this. > > The problem with symbols in Scheme is that they are not namespaced, so > two different modu

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
I wrote: > If he would like people to be able to write code that uses his library > and works on multiple Scheme implementations, then it will certainly be > an impediment to use a Racket-specific value for Nil on Racket, and a > Guile-specific value for Nil on Guile. It would be much better to us

Re: A value for "nothing"

2018-08-27 Thread Hans Åberg
> On 27 Aug 2018, at 22:12, Mark H Weaver wrote: > > More generally, even for people only interested in supporting Guile, if > they would like their libraries to be usable from Elisp code on Guile, > which may become important some day if Guile-Emacs matures, then it's > problematic to use #nil

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
writes: > On Sun, Aug 26, 2018 at 04:07:13PM -0400, Mark H Weaver wrote: > >> I would also avoid Guile's #nil. That is a very special value, for one >> purpose relating to Elisp compatibility, and ideally it should not be >> used for anything else. > > I must admit that I'm... pretty confused ab

Re: A value for "nothing"

2018-08-27 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: > I would suggesting returning zero values, using: > > (values) > > That way, if a caller wrongfully attempts to get at the return value of > that procedure, it’ll get an error. > > Fibers does that in several places, and I think it’s a good convention > as

Re: A value for "nothing"

2018-08-27 Thread Ludovic Courtès
Hi, I would suggesting returning zero values, using: (values) That way, if a caller wrongfully attempts to get at the return value of that procedure, it’ll get an error. Fibers does that in several places, and I think it’s a good convention as it conveys exactly what you want. Ludo’.

Re: A value for "nothing"

2018-08-27 Thread John Cowan
On Mon, Aug 27, 2018 at 12:54 AM Mark H Weaver wrote: > However, in most cases, symbols are precisely what's needed to represent > distinguished atomic objects such as this. > The problem with symbols in Scheme is that they are not namespaced, so two different modules can use the same symbols i

Re: A value for "nothing"

2018-08-27 Thread HiPhish
I think I understand: it just so happens that `(if #f #f)` evaluates to `#`, but it would still be valid if it evaluated to 5 or "roflcopter". > "The return value of a function that returns nothing" is a > self-contradictory notion, if you think about it :) I was under the impression that in Lis

Re: A value for "nothing"

2018-08-27 Thread Panicz Maciej Godek
pon., 27 sie 2018 o 10:17 napisał(a): > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Mon, Aug 27, 2018 at 02:17:06AM +0200, Panicz Maciej Godek wrote: > > niedz., 26 sie 2018 o 16:09 HiPhish napisał(a): > > > > > Hello Schemers, > > > > > > I am writing an implementation of MessagePack

Re: A value for "nothing"

2018-08-27 Thread HiPhish
On Montag, 27. August 2018 02:17:06 CEST you wrote: > In my experience, if #f doesn't make sense as a legal value, then using #f > is probably the idiomatic Scheme way to go. > It composes with SRFI-2's and-let* in a way similar to Haskell's Nothing > within the "do" notation. > I did find it usefu

Re: A value for "nothing"

2018-08-27 Thread HiPhish
Yes, this sounds like the best solution so far. On Sonntag, 26. August 2018 23:07:26 CEST you wrote: > The eq? predicate is able to distinguish the three. But I think using a > singleton record is best: > > (define-record-type ( nil? make-nil)) > (define nil (make-nil)) > > and thene export nji

Re: A value for "nothing"

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 26, 2018 at 04:07:13PM -0400, Mark H Weaver wrote: [...] > It's true that Guile historically has a special object distinct from all > other objects, which (if #f #f) and various other expressions return, > and which prints as "#". > > Ho

Re: A value for "nothing"

2018-08-27 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Aug 27, 2018 at 02:17:06AM +0200, Panicz Maciej Godek wrote: > niedz., 26 sie 2018 o 16:09 HiPhish napisał(a): > > > Hello Schemers, > > > > I am writing an implementation of MessagePack [1] for Guile and a part of > > the > > spec is the pre

Re: A value for "nothing"

2018-08-26 Thread Mark H Weaver
John Cowan writes: > Well, you could use #nil, a Guile-specific unique object that is both falsy > (like #f) and answers #t to the null? predicate. It is used to emulate > Common Lisp's and Elisp's nil. As I wrote earlier, I would avoid using #nil for anything outside of its intended use case.

Re: A value for "nothing"

2018-08-26 Thread Panicz Maciej Godek
niedz., 26 sie 2018 o 16:09 HiPhish napisał(a): > Hello Schemers, > > I am writing an implementation of MessagePack [1] for Guile and a part of > the > spec is the presence of a "nil" data type. What would be a good value to > express "nothing" in Guile? I cannot use '() because that would be > i

Re: A value for "nothing"

2018-08-26 Thread Matt Wette
On 08/26/2018 01:07 PM, Mark H Weaver wrote: HiPhish writes: I am writing an implementation of MessagePack [1] for Guile and a part of the spec is the presence of a "nil" data type. What would be a good value to express "nothing" in Guile? However, I would strongly advise against writing c

Re: A value for "nothing"

2018-08-26 Thread HiPhish
The main advantage of JSON is that it is human-readable. This is great if you want to save the data on disc and be able to get it without needing special software, or if you want to write it out by hand but be able to parse it by a computer. I actually had done that, I maintained a number of rec

Re: A value for "nothing"

2018-08-26 Thread Mark H Weaver
Hi, HiPhish writes: > I am writing an implementation of MessagePack [1] for Guile and a part of the > spec is the presence of a "nil" data type. What would be a good value to > express "nothing" in Guile? First of all, thank you very much for asking the question. I often wish that authors of

Re: A value for "nothing"

2018-08-26 Thread John Cowan
Well, you could use #nil, a Guile-specific unique object that is both falsy (like #f) and answers #t to the null? predicate. It is used to emulate Common Lisp's and Elisp's nil. But a more portable approach would be to define a record type with no slots and make just one instance of it. On Sun,

Re: A value for "nothing"

2018-08-26 Thread Thomas Morley
2018-08-26 12:13 GMT+02:00 HiPhish : > Hello Schemers, > > I am writing an implementation of MessagePack [1] for Guile and a part of the > spec is the presence of a "nil" data type. What would be a good value to > express "nothing" in Guile? I cannot use '() because that would be > indistinguishabl

Re: A value for "nothing"

2018-08-26 Thread Joshua Branson
HiPhish writes: > Hello Schemers, > > > [1] https://msgpack.org/ Thanks for mentioning this! I'm not sure how to answer your question, but thanks for pointing out msgpack. I hadn't realized that json could be faster if it was encoded in binary. That's awesome!

A value for "nothing"

2018-08-26 Thread HiPhish
Hello Schemers, I am writing an implementation of MessagePack [1] for Guile and a part of the spec is the presence of a "nil" data type. What would be a good value to express "nothing" in Guile? I cannot use '() because that would be indistinguishable from the empty list, so I thought that the