[ 
https://issues.apache.org/jira/browse/SYSTEMML-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15889290#comment-15889290
 ] 

Matthias Boehm commented on SYSTEMML-259:
-----------------------------------------

just explain where this is coming from: originally our dml-bodied functions 
were meant to be side-effect-free, i.e., no prints and writes; without side 
effects, there is no point in having functions without returns.

Anyway, I also think that this is a useful extension. The required changes 
should be fairly local to the language-level.

> If no return type specified, DML/PyDML function calls require an lvalue
> -----------------------------------------------------------------------
>
>                 Key: SYSTEMML-259
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-259
>             Project: SystemML
>          Issue Type: Improvement
>          Components: APIs
>            Reporter: Deron Eriksson
>            Assignee: Deron Eriksson
>            Priority: Minor
>
> If a function is defined in DML or PyDML with no return type, and then this 
> function is called, it requires an lvalue variable to be assigned the value 
> returned from the function, even though no value is returned from the 
> function.
> DML Example (assigning to z is required):
> {code}hello = function() {
>       print('hi')
> }
> z = hello(){code}
> PyDML Example (assigning to z is required):
> {code}def hello():
>       print('hi')
> z = hello(){code}
> DML Example (error: "function call needs to have lvalue (Quickfix: change it 
> to 'tmpVar = hello(...)')"):
> {code}hello = function() {
>       print('hi')
> }
> hello(){code}
> PyDML Example(error: "function call needs to have lvalue (Quickfix: change it 
> to 'tmpVar = hello(...)')"):
> {code}def hello():
>       print('hi')
> hello(){code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to