Felix now has minimal support for non-terminating procedures:
fun exit(x:int): any = { ... }
The return type "any" tells Felix the procedure/function will not return.
At present this only works for procedures, i.e. calls like:
exit 1;
although it's supposed to eventually work in conditional expressions
(functional
match branches).
There are three types of such animals:
(1) deliberate infinite loops (eg stream drivers, thread workers, etc)
(2) Program exits
(3) Exception throws (abnormal termination exits)
The last case isn't really supported in Felix by exceptions, but you can
do non-local gotos, so this is for error handlers that jump down the stack
but don't actually terminate the program.
I had to add this support to make the reachability code sane: we need to know
when a call will not return. Note, we're interested here in "definitely never
returns
normally" and not "maybe, maybe not".
So my question is: to make it clearer what should we call these beasts?
err f(.. ) { ... }
make sense except infinite loops aren't errors. Perhaps
sick f ( .. ) { .. }
would appeal to the yunguns. Or maybe just
noreturn f ( .. ) { .. }
Well. In the meantime, returning "any" should suffice.
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language