You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 16, 2024. It is now read-only.
In the above R code, function_two is an inner function.
Things to consider when parsing an inner function:
The name of the inner function: The name should make it clear that this is a function inside of another function and should have the name of the parent function in it. Proposing that we use the dot notation to represent that the inner function is a property of the parent function. For example, in the above example the name of the inner function would be function_one.function_two.
Handling closure variables: The inner function is able to use variables that are in the parent function's environment. For example,
In the above example, function_two is able to use the variable a even though its not declared anywhere in its scope. In PMML however each function has only one scope, its own. To accommodate this R feature when the inner function is parsed into PMML:
Any accessed variables that are not in its scope will need to be added as extra parameters to the inner function's signature
The names of these new parameters should use the same dot notation as in the inner function's name.
Keeping the above points into account, the PMML for function_two would look like,
An inner function is a function declared inside of another one, for example,
In the above R code,
function_two
is an inner function.Things to consider when parsing an inner function:
function_one.function_two
.function_two
is able to use the variablea
even though its not declared anywhere in its scope. In PMML however each function has only one scope, its own. To accommodate this R feature when the inner function is parsed into PMML:function_two
would look like,<<-
The text was updated successfully, but these errors were encountered: