This was first asked by Leo in the Whispers chat room:
But I have a general question about Whispers submissions: couldn't we avoid counting the final Output line most of the time? We can consider the rest of the program a function returning the desired output, printing it to the screen with a full program is not generally required for submissions
This seems, to me, as though an edge case of the general I/O formats, so posting an answer over to the I/O defaults may not allow for appropriate discussion.
For those unfamiliar with Whispers, programs work line-by-line where each line returns a specific value. Lines are "called" by other lines through references in order to get the value from that line. For example, the basic Hello World program:
> "Hello, World!"
>> Output 1
As you can probably figure out, the last line "calls" line 1 and outputs the result.
However, by Leo's argument above, an equally valid program per our I/O rules would be
> "Hello, World!"
as you could consider this a function which returns the string "Hello, World!"
when "called" by another line referencing it.
This meets our requirements for a function (it is reusable, lines can be composed with arguments, lines can call other lines etc.), but it definitely isn't a standard function.
Thoughts? Should Whispers programs be allowed to ignore a final >> Output
line and consider the rest of the program as a function that returns the output?
Hello, world!
challenge doesn't allow functions anyway, so this may not be the best example. \$\endgroup\$