From: Alex Kost <alezost@gmail.com>
To: Alex Vong <alexvong1995@gmail.com>
Cc: guix-devel@gnu.org, John Darrington <jmd@gnu.org>
Subject: Re: [PATCH] gnu: Add sendmail
Date: Sat, 24 Sep 2016 20:50:47 +0300 [thread overview]
Message-ID: <87lgyhdw5k.fsf@gmail.com> (raw)
In-Reply-To: <87h995ogge.fsf@gmail.com> (Alex Vong's message of "Sat, 24 Sep 2016 16:22:09 +0800")
Alex Vong (2016-09-24 16:22 +0800) wrote:
> Alex Kost <alezost@gmail.com> writes:
>
>> John Darrington (2016-09-17 12:11 +0200) wrote:
>>
>>> On Sat, Sep 17, 2016 at 05:38:26PM +0800, Alex Vong wrote:
>> [...]
>>> > > + "contrib/mmuegel" "devtools/bin/configure.sh")
>>> > > + (("/bin/sh") (which "bash")))
>>> > > +
>>> > > + (substitute* "devtools/bin/Build"
>>> > > + (("SHELL=/bin/sh") (string-append "SHELL=" (which "bash"))))
>>> > > + #t))
>>> > I think the `#t' is not neccessary here, since `substitute*' uses
>>> > `substitute', which will either return #t or throw an exception.
>>> >
>>> > WTF?? Didn't you complain earlier this week when I *didn't* put #t in
>>> > exactly this
>>> > scenario??
>>> >
>>> Yes, I am a different Alex :)
>>> Also, it seems we are not being consistent here, sometimes we put `#t'
>>> after `substitute*', sometimes we don't. Anyone has an idea?
>>>
>>> I did raise some suggestions in my earlier posts. But again I don't
>>> have any strong
>>> opinion.
>>
>> I have a strong opinion: if a docstring of a procedure says what value
>> it returns, we can rely on it, otherwise we should not guess what value
>> will be returned. In case of 'substitute*' (and 'substitute'), the
>> returned value is not specified, so I think if a phase ends with
>> 'substitute*', we should (or even must) add #t after it.
>
> I see your point that one should not be relying on undocumented
> features, which I agree. But I also see an alternative: to make
> 'substitute*' either return true or throw an exception and document
> it. I think the heart of the problem is scheme is "untyped", so we rely
> on the documentation. What do you think?
I don't think my opinion matters, I'm not the man to decide. As for me,
I would prefer if 'substitute*' returned #t if substitution was
successful and #f if it failed (if nothing was substituted).
OTOH 'substitute*' is only one of the several procedures that are used
often in phases; there also can be met such general guile procedures as
'setenv', 'copy-file', etc. After them (in the end of the phases) we
have to use #t anyway.
--
Alex
prev parent reply other threads:[~2016-09-24 17:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 16:21 [PATCH] gnu: Add sendmail John Darrington
2016-09-17 4:51 ` Alex Vong
2016-09-17 8:50 ` John Darrington
2016-09-17 9:03 ` John Darrington
2016-09-17 9:38 ` Alex Vong
2016-09-17 10:11 ` John Darrington
2016-09-18 19:14 ` Alex Kost
2016-09-24 8:22 ` Alex Vong
2016-09-24 17:50 ` Alex Kost [this message]
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=87lgyhdw5k.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=alexvong1995@gmail.com \
--cc=guix-devel@gnu.org \
--cc=jmd@gnu.org \
/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.