Redirecting functions calls ?
Sean Hinde
sean.hinde@REDACTED
Mon Apr 26 22:56:53 CEST 2004
Hi,
What I was trying to do was something like:
test(A) when is_integer->
i.e. I was distracted while typing in the guard
Sean
On 23 Apr 2004, at 16:22, Vance Shipley wrote:
>
> Can someone tell me what this is supposed to do?
> (Apart from what was requested :)
>
> I really fail to see what is being attempted here.
> 'fred' is a guard expression. I see that a valid
> guard expression is "constants (terms and bound
> variables) all regarded as false". So wouldn't
> the the following be equivalent (and more clear)?
>
> test(A) when false ->
>
> As I read it you have a function with one clause
> which will never match and so never be called.
>
>
> -Vance
>
>
> Sean Hinde <sean.hinde@REDACTED> writes:
> }
> } -module(compiler_bug).
> } -export([test/1, wow/1]).
> }
> } test(A) when fred ->
> } {ok, A}.
> }
> } wow(A) ->
> } wow.
More information about the erlang-questions
mailing list