[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: spawning functions that return value



The Inferno Support Team wrote:
> 
> Greg,
> 
> Sounds like a bug.  Perhaps submit to Inferno mailing list:
> inferno@interstice.com
----------------------------------------------------------------------------
----
> From: Greg Kochanski <gpk@research.bell-labs.com>
> To: infernosupport@bell-labs.com
> 
> It should not be an error to spawn a function that
> returns a value, just a warning.   The return
> value should simply be ignored.
> 
> There seems little reason to differentiate between
> a call that doesn't use the function's value and
> a spawn.  See below.
> 
> func(x: int): int
> {
>  return print("hello %d\n", x);
> }
> 
> ...
> func(4);        # OK.
> 
> ...
> spawn func(4);  # currently illegal.
> 
> Right now, one has to go through the rigamarole
> of writing a wrapper function that does nothing
> but ignore the returned value.