guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question regarding substitute* and #t


From: Andy Wingo
Subject: Re: question regarding substitute* and #t
Date: Wed, 24 Jan 2018 16:27:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

On Wed 24 Jan 2018 15:45, Hartmut Goebel <address@hidden> writes:

> Am 24.01.2018 um 13:14 schrieb Andy Wingo:
>> On Wed 24 Jan 2018 13:06, Mark H Weaver <address@hidden> writes:
>>
>>> +             ;; Install to the right directory
>>> +             (substitute* '("Makefile"
>>> +                            "Qsci/Makefile")
>>> +               (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+")
>>> +                (assoc-ref outputs "out")))
>>> +             #t)))))
>> I guess once we switch over all instances of "system" and "system*" to
>> use invoke, does that mean we will also be able to remove these
>> vestigial "#t" returns?
> I wonder why substitute* not simply returns #t?!

There was a proposal to make it return #t!  However then someone pointed
out that actually instead of making phases return boolean results, we
should instead signal problems via exceptions, and that drove the shift
from system / system* to invoke.  In the future world where completion
means success, it doesn't matter what substitute* returns.

However!  Because it doesn't matter, perhaps in the interest of
transition we should make substitute* return #t, so that once we switch
to the new exception-based error signalling, that we have less code to
clean up later.

Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]