Logo

Programming-Idioms

History of Idiom 3 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-09-03, 21:07:14

Version 12

2015-10-27, 03:05:01

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Code
-spec procedure() -> _.
procedure() -> io:format("#YOLO!~n").
Comments bubble
There is no way to avoid returning a value here. This function returns ok. But you can add -spec to say that you should not care about the result.