systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deron Eriksson <>
Subject function default parameters
Date Fri, 21 Apr 2017 23:18:13 GMT
Is there a way to set default parameter values using DML? I believe both R
and Python offer this capability.

The only solution I could come up with using DML is to pass in a variable
that is NaN and cast this to a string and use this string in an if
conditional statement.

addone = function(double b) return (double a) {
    c = ''+b;
    if (c == 'NaN') {
        b = 2.0
    a = b + 1;

x = addone(z);
y = addone(4.0);

Is there a cleaner way to accomplish this, or is DML lacking this R feature?


Deron Eriksson
Spark Technology Center

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message