1
\$\begingroup\$

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\$
5
  • \$\begingroup\$ It looks like With(Math) is just an import and not part of the function itself. \$\endgroup\$ Apr 10, 2018 at 17:37
  • \$\begingroup\$ Seems like between this and this, you have your answer. \$\endgroup\$ Apr 10, 2018 at 17:39
  • \$\begingroup\$ Are you asking about an anonymous function? \$\endgroup\$
    – Riker
    Apr 10, 2018 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, 2018 at 18:44
  • \$\begingroup\$ An extra problem comes: Do I have to always have extra edit from tio template? \$\endgroup\$
    – l4m2
    Apr 10, 2018 at 18:46

0

Browse other questions tagged .