bugmake - Bugs: bug #59752, feature request: quote/expand...

 
 

bug #59752: feature request: quote/expand function

Submitter:  Aleksey Covacevice <alecov>
Submitted:  Tue 22 Dec 2020 07:00:07 PM UTC
   
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Enhancement Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Component Version:  None
Operating System:  None Fixed Release:  None
Triage Status:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Tue 22 Dec 2020 07:00:07 PM UTC, original submission:  

It would be nice to have a $(quote) function which escapes a string for safe use within $(eval) contexts:

That is:

    define y
    1 # x
    z = 2
    endef

    $(eval x = $y)          # x = 1, and introduces z = 2
    $(eval x = $(quote $y)) # x = 1 # x\nz = 2


Also, the $(value) function is inconsistent with regards to $'s between simple and recursive variables:

    a1  = $x $$y \# z
    a2 := $x $$y \# z
    $(info $(value a1)) # Prints '$x $$y # z'
    $(info $(value a2)) # Prints ' $y # z'

This also might give problems in $(eval) contexts eg:

    $(eval b1 = $(value a1)) # b1 = $x $$y
    $(eval b2 = $(value a2)) # b2 = $y

    # $(quote $(value)) doesn't fit:
    $(eval b1 = $(quote $(value a1))) # b1 = $$x $$$$y \# z
    $(eval b2 = $(quote $(value a2))) # b2 = $$y \# z

Hence, I'd suggest also introducing $(expand) which is similar to $(quote) above, but for variables:

    $(eval b1 = $(expand a1))) # b1 = $x $$y \# z
    $(eval b2 = $(expand a2))) # b2 = $$y \# z

Aleksey Covacevice <alecov>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by alecov (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code