bugmake - Bugs: bug #51286, Support for additional local make...

 
 

bug #51286: Support for additional local make variables

Submitted by:  Markus Elfring <elfring>
Submitted on:  Wed 21 Jun 2017 05:00:14 PM UTC  
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.2.1 Operating System:  Any
Fixed Release:  None Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 29 Mar 2020 04:01:22 PM UTC, comment #3: 

> Dit I?


Wow, indeed, my memory is quite far off. Sorry!

I was thinking of an exchange regarding a request for renaming by thutt. Your only expressed concern was that the behavior of let bindings might not be clear to people not familiar with languages that have such bindings, i.e.

> In Lisp, "let" creates "local bindings" not a new scope.  I'm not sure if that is more or less clear for people not familiar with Lisp.


My remark on "not fitting the design" was probably my mind trying to think of good reasons to keep $(let) out of make. It may have been my own concern more than yours ;-).

Jouke Witteveen <jwitteveen>
Sun 29 Mar 2020 03:39:46 PM UTC, comment #2: 

> 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


Did I?  I don't remember saying anything like that...

Paul D. Smith <psmith>
Project Administrator
Sun 29 Mar 2020 01:32:33 PM UTC, comment #1: 

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)

Jouke Witteveen <jwitteveen>
Wed 21 Jun 2017 05:00:14 PM UTC, original submission:  

The documentation contains the following information:
“…
The call function can be nested. Each recursive invocation gets its own local values for $(1), etc. that mask the values of higher-level call.
…”

The creation of temporary variables (which are just numbered) is already supported by this programming interface for function parameters.
I would like to use similar functionality in the way that make variables can be adjusted within an customised scope so that variables in other scopes can be left untouched.
With which additional function calls can corresponding variable scopes be managed?

Markus Elfring <elfring>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48701:  let-function.patch added by jwitteveen (3KiB - text/x-patch - let expressions (no documentation))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by jwitteveen (Updated the item)
  • -email is unavailable- added by elfring (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-29 jwitteveen Attached File- => Added let-function.patch, #48701

    Back to the top


    Powered by Savane 3.5