Skip to content

Conversation

@ctrueden
Copy link
Member

When no explicit @OUTPUT is given, the return value is appended.

When an explicit @OUTPUT is given, the return value is not appended.

See knime-ip/knip-scripting/issues/78.

@ctrueden
Copy link
Member Author

ctrueden commented Jun 19, 2016

@gab1one Please test, and merge if satisfied.

ctrueden added 5 commits July 1, 2016 12:55
There may be other reasons affecting the decision to append the
script's return value as an extra output. Let's be flexible.
Rather than relying on the return value being stored as an extra output,
let's save the return value as its own reference. That way, in cases
where the return value does _not_ get appended as an extra output,
we still have a handle on it.
We want the return value to be an easy way to return a single, untyped
(Object) output. This is quite useful for the "lazy" (I mean "elegant")
script writer. But for those consuming scripts, it is annoying to always
have to deal with this extra "result" output.

As a compromise, let's only append the "result" output if:
A) no other outputs were declared; and
B) "result" was not declared as an input either.
When _no_ explicit @output is given, the return value _is_ appended.
When an explicit @output _is_ given, the return value is _not_ appended.
@ctrueden
Copy link
Member Author

ctrueden commented Jul 1, 2016

@gab1one Any progress? I just rebased this over the latest master, so that it continues to merge cleanly.

@ctrueden
Copy link
Member Author

@gab1one Since I have still not heard back, I am going to merge this. I hope it does not break anything.

@ctrueden ctrueden merged commit fe1e811 into master Aug 12, 2016
@ctrueden ctrueden deleted the return-values branch August 12, 2016 20:05
@ctrueden ctrueden added this to the 2.58.0 milestone Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants