[Swift-devel] Re: How to wait on functions that return no data?

Mihael Hategan hategan at mcs.anl.gov
Wed Mar 26 04:50:50 CDT 2008


On Tue, 2008-03-25 at 23:18 +0000, Ben Clifford wrote:
> On Tue, 25 Mar 2008, Mihael Hategan wrote:
> 
> > > where each element is of type 'maybe resultfile' and so can (independent 
> > > of the other elements) be a file or null.
> > 
> > pretty much like try {a[x] = f(x)} catch {} or maybe(a[x] = f(x)).
> 
> in the array case, sort of, yes.
> 
> Doesn't compare so well when passing round a single non-array value though 
> - a = Nothing is different from a not being assigned (yet, or never), 
> which is what syntax this like: try { a =f(x) } catch {} alludes to.

Right. Though one could say catch() {a = Nothing}.

> 
> The try/catch syntax also alludes to a null response being somehow 
> exceptional, rather than a legitimate return value.
> 

Not the null response, but actually f throwing an exception.




More information about the Swift-devel mailing list