moving general-purpose functions from httpd_util to stdlib
Bengt Kleberg
eleberg@REDACTED
Wed Apr 16 06:59:51 CEST 2003
> Date: Tue, 15 Apr 2003 13:06:08 -0500
> From: Chris Pressey <cpressey@REDACTED>
...deleted
> herring that clouds the issue. The question is more about whether it is
> wiser, in general, to write "open" or "closed" cases.
>
> A (possibly) better example:
>
> % "open" case
> case A > B of
> true ->
> 41;
> _ ->
> 42
> end
>
> % "closed" case
> case A > B of
> true ->
> 41;
> false ->
> 42
> end
i think that your ''closed'' case is the one i use. given a finite (2)
set of results i match them all.
> % "let-it-crash" style - seems almost like a different problem
> case catch begin
> true = A > B,
> 41
> end of
> {'EXIT', Reason} ->
> 42;
> Result ->
> Result
> end
here you have lost me. i thought the ''closed'' case was the
''let-it-crash'' style. and that one would guard oneself against
crashes by doing:
case catch (A > B) of
true ->
41;
false ->
42;
_Other ->
42
end
i understand this is not what you mean, but fail to understand what it
is you do mean. sorry.
bengt
More information about the erlang-questions
mailing list