28
$\begingroup$

When assigning attachment operators, I often run into confusing statements like ##@@##&, ##@@@##&, or even ##@@@##&@*##@@##&. Example:

x = ##@@@##&@*##@@##&;

x[{a b, c d}]
(*    {a b, c d}[{a b, c d}[a b, c d][a, b], {a b, c d}[a b, c d][c, d]]    *)

Is there a preferred causal order, ontic basis, or at least a post-categorical meta-category for clarifying these unstable lambdas?

$\endgroup$
8
  • 12
    $\begingroup$ It took me a while :) $\endgroup$
    – Kuba
    Apr 1, 2022 at 10:33
  • 8
    $\begingroup$ Well, there's always FullForm. But if it's your kids who are writing code like that, it means you're not spanking them enough. $\endgroup$ Apr 1, 2022 at 14:57
  • 7
    $\begingroup$ I assume that this is an April 1st joke, but I don't get it. :( $\endgroup$
    – march
    Apr 1, 2022 at 16:35
  • 6
    $\begingroup$ @march there were more explanations in the link given in the original, but the link was edited away unfortunately. $\endgroup$
    – Roman
    Apr 1, 2022 at 16:59
  • 5
    $\begingroup$ @DanielLichtblau my kids are only allowed hexadecimal machine code until they're 12. $\endgroup$
    – Roman
    Apr 1, 2022 at 17:04

1 Answer 1

18
$\begingroup$

It's a beginner's error to put @@@ before @@:

#2~(##2&)~##3&@@##3~#1~#2&@@@{
  Plot[O, r, S, n, a, p],
  DSolve[G, i, r, l!],
  FindFit[S, l, o, w],
  True[G, o, O, f, f],
  Table[i, s!, a!, l, o, l]}

It produces the desired output, but eventually Mathematica has a come-back:

O::argt: O called with 5 arguments; 1 or 2 arguments are expected.

$\endgroup$
1
  • 11
    $\begingroup$ Snap, that's it! @@ before @@@, except after /*. Now I remember, thanks! $\endgroup$
    – Roman
    Apr 1, 2022 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.