1
$\begingroup$

I'd like to express the function F = Function[{#2[[1]] + #1[[2]]/#1[[1]], #2[[2]] + 1/#1[[1]]}] using explicit formal parameters.

I've tried G = Function[{{a, b}, {c, d}},{c + b/a, d + 1/a}] but this doesn't seem to work. Can anyone tell me how to do this?

$\endgroup$
2
  • $\begingroup$ The error message is pretty self-explanatory isn't it? Is there some reason you can't do g[{{a_, b_}, {c_, d_}}] := {c + b/a, d + 1/a}? $\endgroup$ Commented May 30, 2016 at 23:03
  • $\begingroup$ I could do something like that (g[{a_, b_}, {c_, d_}] := {c + b/a, d + 1/a}), but I want to do it anonymously with explicit parameters. $\endgroup$
    – pdmclean
    Commented May 30, 2016 at 23:14

0

Browse other questions tagged or ask your own question.