Skip to content

can $ variable be a (c)function? #820

@veretin

Description

@veretin

Hi,

I need to capture function name into $ variable. Example

s x;
c f;

g expr = f(x);

  if ( match( f?$f(x?) ) );
  multiply $f(1);
  endif;

moduleoption noparallel;
.sort

print;
.end

The output is

TFORM 5.0.0 (Mar 17 2026, v5.0.0-10-gc549571) 0 workers  Run: Thu Apr 16 20:17:46 2026
    s x;
    c f;
    
    g expr = f(x);
    
      if ( match( f?$f(x?) ) );
      multiply $f(1);
test.frm Line 7 --> Illegal use of function arguments
      endif;
    
    moduleoption noparallel;
    .sort
    
    print;
    .end
Program terminating in thread 0 at  --> 
Terminate called from pre.c:1086 (PreProcessor)
  0.00 sec + 0.00 sec: 0.00 sec out of 0.00 sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions