[erlang-questions] Trying to learn the Erlang Way

Vlad Dumitrescu vladdu55@REDACTED
Fri Feb 7 08:27:28 CET 2014


Hi,

On Fri, Feb 7, 2014 at 8:25 AM, kraythe . <kraythe@REDACTED> wrote:
> coordinateGreaterThan(V, {X, Y, Z}) when X > V; Y > V; Z > V -> true;
> coordinateGreaterThan(_, _) -> false.
>
> %% Culls the list of vectors X to only those that are in the sphere devined
> by vector C as a center and R as a radius.
> cull(C, R, Vectors) when is_number(R), is_tuple(C) -> cull(C, R, Vectors,
> []).
> cull(C, R, Culled, []) -> Culled;
> cull(C, R, Culled, [Head|Tail]) ->
>   D = subtract(C, Head),
>   case coordinateIsGreaterThan(R, Head) of
>     true -> cull(C, R, Culled, Tail);
>
> 1) Why is it saying my coordinateIsGreaterThan/2 method is undefined when I
> can see it here and then to say it is unused in the next line? That seems
> contradictory?

Look carefully and see that you define "coordinateGreaterThan" and
call "coordinateIsGreaterThan".

regards,
Vlad



More information about the erlang-questions mailing list