Custom Query (100 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (58 - 60 of 100)

Ticket Resolution Summary Owner Reporter
#72 fixed kmk: Add .RETURN and .ARGC to $(evalcall ) and $(evalcall2 ) for creating functions bird bird
Description

To create more complicated functions without also creating an unreadable mess, it's necessary to make $(evalcall[2] ) be able to return a value. This is implemented using a local variable .RETURN, the function body assigns the desired return value to this variable.

Example:

define POP
local words := $(words $($1))
local .RETURN := $(word $(words), $($1))
$1 := $(wordlist 1, $(expr $(words) - 1), $($1))
endef

stack-var = a b c d
d-element := $(evalcall POP,stack-var)

In addition, it's very useful to have some way of getting at the argument count without evaluating all the possibilities. For this purposed .ARGC was added. It is also applied to $(call ).

#73 fixed kmk: Add generic loop functions $(for ) and $(while ). bird bird
Description

$(for init,condition,next,body) The init part is evaluate up front (no extra expansion). The condition part is a kmk-expression and is evaluate before each iteration. The body is expanded and added to the output, the output from each iteration is separated by a space. The next part is evaluated at the end of each iteration (no extra expansion).

$(while condition,body - Similar to $(for ) with empty init and next.

#74 fixed kmk: $(select whenN-cond, whenN-body...) bird bird
Description

Simple multiple condition statement borrowed from REXX (yet again). Test whenN-cond and expand the whenN-body of the first which holds true. If all are false, the empty string is returned. Special condition strings for the sake of tradition: default, default:, otherwise}}}, and otherwise.

Note: See TracQuery for help on using queries.