﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3709	MetaModelica extension: bidirectional variables	Martin Sjölund	Martin Sjölund	"One annoying thing with MetaModelica is the inability to assign to input variables, and the fact that you need different names for the input and output variables when traversing data structures.

I propose a syntactic sugar for handling bidirectional variables:

{{{#!mo
function f
  input output Exp exp;
  input output Integer i;
algorithm
  exp := match exp
    case ICONST() then ICONST(exp.value+i);
    else exp;
  end match;
end f;
}}}

Which is almost equivalent to:
{{{
function f
  input Exp $in_exp;
  input Integer $in_i;
  output Exp exp=$in_exp;
  output Integer i=$in_i;
algorithm
  exp := match exp
    case ICONST() then ICONST(exp.value+i);
    else exp;
  end match;
end f;
}}}
(The difference being that the type of the function would keep the original names when using named arguments for calling the function).

The benefit would be shorter code and better names. There would be no need to use prefixes in and out to differentiate between two local variables."	enhancement	closed	high	1.11.0	MetaModelica	v1.9.4-dev-nightly	fixed		Adrian Pop Per Östlund openmodelicadevelopers@…
