[erlang-questions] Nested Case Statements v.s. multiple functions
Mon Sep 25 17:26:05 CEST 2017
On 2017年09月26日 火曜日 00:11:00 you wrote:
> handle_request(Target, User, Context, ExternalThingy) ->
Should be handle_request4/4.
> pre_check(Action, User, Context, ExternalThingy) ->
> Checks =
> [fun check_request/2,
> fun check_permission/2,
> fun check_dispatch_target/2,
> fun check_condition/2],
These should all be arity of one, obviously.
I knew something like this was bound to happen at 00:25... ;-)
Anyway, hopefully I explained more than I confused.
The main point remains: you are on the right track and your code will become much nicer to read in short order.
More information about the erlang-questions