[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making substitute* throw an error if substition failed?
From: |
Danny Milosavljevic |
Subject: |
Re: Making substitute* throw an error if substition failed? |
Date: |
Sat, 15 Oct 2016 10:06:41 +0200 |
Hi,
On Sat, 15 Oct 2016 00:05:56 +0200
Ricardo Wurmus <address@hidden> wrote:
> Would it be desirable to change “substitute*” (or replace it) such that
> it throws an error or returns a value if substitution failed? This
> might be helpful for the more complex packages with many substitutions.
> If we make it return a value (#f for error) it would also make our build
> phases a little prettier, I think. (Now we forcefully return #t in any
> case and that seems wrong.)
While it's a big change I am for substitute* throwing an error if it can't find
one of the patterns - and #t otherwise. It's true that these substitutions that
are necessary but cannot be found would not be noticed in a long time otherwise.
I'm against it returning a value #f in the error case - it should just unwind.
If you don't want it to unwind (in a few cases) you can always protect against
it manually.