From: bokr@bokr.com
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 56799@debbugs.gnu.org, attila@lendvai.name,
Tobias Geerinckx-Rice <me@tobias.gr>
Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic
Date: Thu, 28 Jul 2022 06:55:06 +0200 [thread overview]
Message-ID: <20220728045506.GA9725@LionPure> (raw)
In-Reply-To: <87fsim8l17.fsf@gmail.com>
Hi,
On +2022-07-27 14:31:32 -0400, Maxim Cournoyer wrote:
> Hi,
>
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
> > Hi Maxim,
> >
> > Maxim Cournoyer 写道:
> >> I'd suggest we revisit 8cb1a49a3998c39f315a4199b7d4a121a6d66449 to
> >> use
> >> 'unspecified (the symbol) instead of *unspecified*, which *can* be
> >> serialized without any fuss in gexps.
> >
> > Bah. Could we provide our own reader?
> >
> > I'd much rather this be addressed in Guile (or failing that,
> > transparently by Guix) than have to deal with some magical
> > symbol. IIRC that was the argument for using *unspecified* in the
> > first place, and I think it makes sense.
> >
> > This looks more like an unexplored oversight than a well-reasoned
> > restriction to me.
>
> This was my original impression, but thinking more about it, it became
> apparent that *unspecified* is well, unspecified and shouldn't be relied
> on by people to be something well defined. For some background reading,
> see [0]. So it seems wrong in Scheme to actively set things to
> *unspecified*, and give a specific meaning to that.
>
> I think the semantic of the language is that it is to be used as the
> lack of a return value from a procedure or syntax, e.g.:
>
> (unspecified? (if #f 'one-arm-if)) -> #t
>
> Having 'unspecified?' even defined in Guile seems to go against that
> idea; perhaps because Wingo themselves seems to disagree in [0].
>
> I'm also thinking 'unspecified being too close to *unspecified* is
> probably going to cause confusion down the line. Reverting to the
> originally used 'disabled may be the lesser evil.
>
> Other thoughts?
>
> Thanks,
>
> Maxim
>
> [0] https://scheme-reports.scheme-reports.narkive.com/QSQtJSAh/unspecified-values
>
>
>
Lots of systems are dealing with this issue, it seems, judging from
[1] https://en.wikipedia.org/wiki/Bottom_type
I think the problem is you really need a tuple to return both data and metadata
unambiguously from anything that produces a result (or not, which is a result).
Something like read-delimited with the 'split option, or using catch.
Personally, if I were designing a language :), my goal would be to have
nothing unspecified, and no undefined behaviour outside of physical failures ;-)
*unspecified* seems me like an ok word for the unasserted/high-impedance
state of tri-state memory address bus electronic logic,
but IMO the example above
--8<---------------cut here---------------start------------->8---
> (unspecified? (if #f 'one-arm-if)) -> #t
--8<---------------cut here---------------end--------------->8---
is not nice. (A nit, but For one thing "specified?" ought to be the question IMO,
if you are ging to have that concept, not "unspecified?" :)
What about using characters from some private upper unicode section
to represent various kinds of unspecified things? E.g.,
as guile named chars,
#\unspecified_function_retval
#\unspecified_function_error
#\unspecified_macro_err
#\unspecified_exception
#\nil or #\not_an_object -- or #\nao -- can't use #\n :)
#\paradox -- e.g., (eval-nl-string "this sentence is lying")
#\nonsense -- e.g. when a question is based on false premises
(eval-nl-string "Bob is bareheaded: Bob, is your hat too tight?")
Hm, one could argue that (+ "ab" "cd") could be based on the false
premise that + was overloaded like
--8<---------------cut here---------------start------------->8---
scheme@(guile-user) [1]> (let*( (+ string-append) (sum (+ "ab" "cd"))) sum)
$8 = "abcd"
--8<---------------cut here---------------end--------------->8---
and if it wasn't, should return #\nonsense :)
(though maybe as part of the exception, which is practical for debugging etc :)
#\
#\guix_bottom -- a private unicode rather than U+22A5 which could be
returned as a valid character value by some functon.
--8<---------------cut here---------------start------------->8---
$ echo -en "\u22a5"|unicode-info
"⊥":
glyph codepoint .....int name...
_⊥_ +U0022a5 8869 UP TACK
--8<---------------cut here---------------end--------------->8---
Well, hope you can extract something useful from the above :)
BTW, I didn't get far via the link [0] :(
--8<---------------cut here---------------start------------->8---
🤖 Hungry for data? 🤖
As you guessed, this page is to confirm your affiliation to the human race.
about - legalese
Loading...
--8<---------------cut here---------------end--------------->8---
Ok machine, you identified me as human, and kept me out. Happy?
No, I know, machines can only fake that.
--
Regards,
Bengt Richter
next prev parent reply other threads:[~2022-07-28 4:56 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 16:23 bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-07-27 16:43 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-07-27 18:27 ` Attila Lendvai
2022-07-28 15:15 ` Maxim Cournoyer
2022-07-27 18:31 ` Maxim Cournoyer
2022-07-27 18:45 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2022-07-27 19:09 ` Maxim Cournoyer
2022-07-27 19:45 ` bug#56799: [PATCH] services: configuration: Step back from *unspecified* Maxim Cournoyer
2022-07-27 19:46 ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-07-27 20:20 ` bug#56799: [PATCH v2] gexp: Handle *unspecified* as a gexp input Maxim Cournoyer
2022-07-27 21:43 ` Maxime Devos
2022-07-28 14:58 ` Maxim Cournoyer
2022-07-28 4:41 ` bug#56799: [PATCH v3] " Maxim Cournoyer
2022-08-01 5:08 ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-08-01 10:00 ` Maxime Devos
2022-08-01 12:46 ` Maxim Cournoyer
2022-08-01 13:44 ` Ludovic Courtès
2022-08-01 16:55 ` Maxim Cournoyer
2022-07-28 4:55 ` bokr [this message]
2022-07-28 10:26 ` Maxime Devos
2022-07-28 15:09 ` Maxim Cournoyer
2022-08-01 13:49 ` Ludovic Courtès
2022-08-01 15:55 ` Maxim Cournoyer
2022-08-02 7:31 ` Ludovic Courtès
2022-08-02 8:45 ` bokr
2022-08-02 15:06 ` Maxim Cournoyer
2022-08-04 12:19 ` Ludovic Courtès
2022-08-07 22:44 ` Ludovic Courtès
2022-08-08 22:27 ` Attila Lendvai
2022-08-08 23:35 ` Attila Lendvai
2022-08-10 2:17 ` Maxim Cournoyer
2022-08-10 3:26 ` Maxim Cournoyer
2022-08-11 10:15 ` Attila Lendvai
2022-08-13 6:31 ` Maxim Cournoyer
2022-08-13 16:47 ` Attila Lendvai
2022-08-14 2:57 ` Maxim Cournoyer
2022-08-16 14:00 ` Attila Lendvai
2022-08-17 13:16 ` Maxim Cournoyer
2022-08-17 16:00 ` paren--- via Bug reports for GNU Guix
2022-08-10 0:43 ` Maxim Cournoyer
2022-08-24 12:40 ` bug#56799: [PATCH 1/5] services: configuration: Add a 'maybe-value-set?' procedure Attila Lendvai
2022-08-24 12:40 ` bug#56799: [PATCH 2/5] services: configuration: Add %unset-value exported variable Attila Lendvai
2022-08-24 12:40 ` bug#56799: [PATCH 3/5] services: configuration: Add maybe-value exported procedure Attila Lendvai
2022-08-24 12:40 ` bug#56799: [PATCH 4/5] services: Use the new maybe/unset API Attila Lendvai
2022-08-25 4:18 ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
2022-08-24 12:40 ` bug#56799: [PATCH 5/5] services: configuration: Change the value of the unset marker Attila Lendvai
2022-08-25 4:14 ` bug#56799: (gnu services configuration) usage of *unspecified* is problematic Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220728045506.GA9725@LionPure \
--to=bokr@bokr.com \
--cc=56799@debbugs.gnu.org \
--cc=attila@lendvai.name \
--cc=maxim.cournoyer@gmail.com \
--cc=me@tobias.gr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.