2
\$\begingroup\$

This question already has an answer here:

In this answer, the function is defined as

With(Math)f=(a,b,c,d)=>...    (1)

However, f is not used in the function, so it seems fine to write

With(Math)(a,b,c,d)=>...

(the latter one's return value is also the function)

The point is that, you can't write

f = With(Math)(a,b,c,d)=>...

You either write (1) or

f = eval('With(Math)(a,b,c,d)=>...')

to make f be the function. Is that allowed?

\$\endgroup\$

marked as duplicate by Rɪᴋᴇʀ, Community Apr 10 '18 at 18:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ It looks like With(Math) is just an import and not part of the function itself. \$\endgroup\$ – Erik the Outgolfer Apr 10 '18 at 17:37
  • \$\begingroup\$ Seems like between this and this, you have your answer. \$\endgroup\$ – AdmBorkBork Apr 10 '18 at 17:39
  • \$\begingroup\$ Are you asking about an anonymous function? \$\endgroup\$ – Rɪᴋᴇʀ Apr 10 '18 at 18:23
  • \$\begingroup\$ Thus, from math import* is not valid, but from math import*;gcd is. seems shows that it's allowed \$\endgroup\$ – l4m2 Apr 10 '18 at 18:44
  • \$\begingroup\$ An extra problem comes: Do I have to always have extra edit from tio template? \$\endgroup\$ – l4m2 Apr 10 '18 at 18:46

Browse other questions tagged .