bug-make
[Top][All Lists]
Advanced

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

[bug #51286] Support for additional local make variables


From: Jouke Witteveen
Subject: [bug #51286] Support for additional local make variables
Date: Sun, 29 Mar 2020 09:32:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0

Follow-up Comment #1, bug #51286 (project make):

If the value you are trying to assign to a variable is guaranteed to contain
no spaces, you could use
  $(foreach var,<val>,<...>)
but that is a bit of a hack of course.

More complete lexical scoping was proposed on the mailing list
(https://lists.gnu.org/archive/html/bug-make/2019-12/msg00017.html) in the
form of let expressions
  $(let <var>,<val>,<...>)
but Paul Smith expressed his concern that let expressions may be to foreign to
the audience of make and that they do not fit the overall design of make
nicely.

I have attached the working prototype for implementing let expressions, which
lack documentation. Essentially, each word of <val> is assigned to each
variable name in <var>, where the last variable name gets all remaining words
in <val>. If there are more words in <var> than in <val>, the corresponding
variables will be empty.

(file #48701)
    _______________________________________________________

Additional Item Attachment:

File name: let-function.patch             Size:2 KB
    <https://savannah.gnu.org/file/let-function.patch?file_id=48701>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?51286>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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