This was mentioned in the mailing list at one point, so just making a
comment in the tracker so it can be tracked.
The idea is that currently the only way to directly get a value back from a
function, you have to use a fun. However, funs are not allowed to have
side effects. On the other hand, procs can have side effects, but cannot
return values. This of course can be worked around by passing in a
mutatable object into the function call.
One potential argument for allowing procedural return is that it makes
sense when wrapping external c libraries in felix. If someone sees a
function "fun foo: int -> int", they may expect that this function call has
no side effects. However, if foo is an external function, that function can
do arbitrary things behind the scenes. So it would make sense to have
that function call to be a proc.
I'm sure John has many other reasons for and against this, and can
comment on them if he feels it's important to :)
Log in to post a comment.