piraha contains code for expanding arbitrary variables

Create issue
Issue #1924 closed
Roland Haas created an issue

line 369 of piraha's Call.cc contains code:

    nm_iter iter = variables.find(gr->group(0)->substring());
    if(iter != variables.end()) {
        ret = iter->second;
    }

that would seem to allow arbitrary variable names to be expanded to values. However piraha does not let me assign values to these variables anymore as the only allowed assignments are "ActiveThorns = ..." and "thorn::par = ...".

So either there is code to support no longer allowed operations or there is a lack of documentation on how to set variable values for later use by $varname.

Keyword: Piraha

Comments (5)

  1. Steven R. Brandt
    • removed comment

    So I'm trying to figure out what the corrective action should be for this ticket. A par file of the form

       $a = 3
       $b = $a + 2
    

    Does run, so the code does do something. Did you have some difficulty setting $varname, or is the issue just the documentation?

  2. Roland Haas reporter
    • removed comment

    Ah so that is the syntax one is supposed to use. Yes, there is no documentation for this feature and reading the par.peg file did not make it obvious either what could be done to set variables.

    So, yes, this all boils down to there not being much documentation for the syntax and features of the parameter file parser. This is not a new state of affairs, the $parfile feature was undocumented since its introduction (15 years ago), half of that time intentionally so.

    Since this the parfile parser part of the core Cactus functionality I believe it should be very well documented and that the documentation should always be up to date.

  3. Log in to comment