[erlang-questions] four element 'fun' tuple in abstract form
Paul Mineiro
paul-trapexit@REDACTED
Tue May 19 01:06:54 CEST 2009
hi.
we parse our erlang here as part of our build process. i noticed recently
that we are seeing a 4 element 'fun' tuple in the forms produced from
{ _, _, Forms } = compile:file (F, [ binary, 'E', { outdir, Dir } ])
in particular, using as input the file below (this is from nitrogen),
i get a form of
{'fun',11,{function,validate,2},{0,10451040,'-render_validator/3-fun-0-'}}
i checked the abstract format page at
http://erlang.org/doc/apps/erts/absform.html#4 but i didn't see anything
that corresponded.
can anyone shed some light on what this form is?
-- p
p.z. i'm using erlang r12b-5
the erlang file:
-----------------
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2009 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (validator_is_required).
-include ("wf.inc").
-compile(export_all).
render_validator(TriggerPath, TargetPath, Record) ->
Text = wf_utils:js_escape(Record#is_required.text),
validator_custom:render_validator(TriggerPath, TargetPath, #custom { function=fun validate/2, text = Text, tag=Record }),
wf:f("v.add(Validate.Presence, { failureMessage: \"~s\" });", [Text]).
validate(_, Value) ->
Value /= [].
More information about the erlang-questions
mailing list