Hume (programming language): Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
Example: correction
Line 46:
 
box fib
in (n::integer, flag::integer) -- tuple of inputs, single element mailboxes
outin (nextnn::integer, flag'::integer, result::(integer, integer, string)) -- type of the output with roles
-- type of the output with roles
out (nextn::integer, flag'::integer, result::(integer, integer, string))
-- within 500KB (400KB) -- heap and stack cost boundings (compiler only)
-- woud throw HeapOverflow, StackOverflow
Line 54 ⟶ 56:
match
-- pattern for the tuple of inputs -> expression_with_type_of_the_''out''_tuple
-- * wildcards for unfilled outputs, and unconsumed inputs
 
(n, 0) -> if n >= 99 then raise EIncredible (n, " reached")
else (n+1, 0, (n, bfibo n, "\n"))
| (n, 1) -> (n, 0, (n, *, " Timeout thrown\n")) -- * wildcards for unfilled outputs, and unconsumed inputs
| (n, 2) -> (n, 0, (n, *, " EIncredible thrown\n"))
 
Line 64 ⟶ 67:
-- exception_pattern -> expression_with_type_of_the_out_tuple
 
Timeout () -> ( 0, 1, (*, *, "AtrapatTimeout temporitzaciocaught, reiniciemwe restart n ato 0\n"))
| EIncredible (n, msg) ->
(0, 2, (*, *, "IncreibleIncredible: " ++ (n as string) ++ msg ++ ", reiniciemwe restart n ato 0\n"))
| EIlegalArgument msg -> (0, 0, (*, *, "ArgumentIlegalIlegal argument: " ++ msg ++ "\n"))
;
 
Line 84 ⟶ 88:
;
</source>
 
== External links ==