help-make
[Top][All Lists]
Advanced

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

Sane and general character esacping (was: Handling '=' in a filename tog


From: Stefan Monnier
Subject: Sane and general character esacping (was: Handling '=' in a filename together with $(eval ))
Date: Fri, 14 Feb 2025 17:46:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> Any hope to see a version of GNU Make that lifts those limitations,
>> providing some sane way to handle any character in filenames (and
>> ideally also able to sanely manipulate lists of such names)?
> A number of years ago I proposed a way to deal with special characters.
> You can find the start of the thread here:
> https://lists.gnu.org/archive/html/make-alpha/2014-02/msg00003.html
> If you have the patience to read it, you will definitely learn why
> something like this is so difficult :).

As you mention there, a core problem is:

    Because make variables can be expanded multiple times and in various
    contexts, using a common escape scheme such as prefixing characters
    with backslashes is complex.

It's a nasty problem, I agree.

> Probably it's worth re-reading with another 10 years of experience.

I don't have any great idea to contribute, I'm afraid.
But a solution which manages to be "sane", would significantly improve Make's
usability, IME.  And it wouldn't need to be 100% backward/POSIX
compatible, if you ask me.  It's probably more important that it be sane
(for the user) and with limited impact on the implementation.

AFAIK, the sanest way I've seen to handle escaping in a language where
"everything is a string" is the way Tcl did it.  I'm no fan of Tcl, but
I must admit that within the constraints that it imposed itself, I think
it did a better job than anyone else.  I think the principle is similar to
Ford's [matchertext](https://bford.info/2023/01/02/matchertext/).


        Stefan




reply via email to

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