Hello,<br><br>I have a record with a member to which I assign a function:<br><br>$ cat test.hrl<br>-record(test, { my_fun }).<br>$<br><br>and, from the Erlang shell:<br><br>18> rr("test.hrl").<br>[test]<br>19> X=#test{my_fun = fun(X) -> X*2 end}. <br>
#test{my_fun = #Fun<erl_eval.6.49591080>}<br><br>When I try to invoke the function, the shell complains with a syntax error:<br><br>20> X#test.my_fun(1).<br>** 1: syntax error before: '(' **<br><br>Of course, it does work when first assigning the record-member to a variable:<br>
<br>21> Y=X#test.my_fun.<br>#Fun<erl_eval.6.49591080><br>22> Y(1).<br>2<br><br>Is there some syntactical subtlety I'm missing out on, or is this something I should just not want?<br><br>Thanks,<br><br>Jeroen<br>
<br>