2
$\begingroup$

This is a follow-up to this question. Consider:

f = #^2&
g = #^3&

Compose[f, g]
(#1^3 &)^2

Am I the only one to think this is a bug?

$\endgroup$
5
  • 4
    $\begingroup$ Note that Compose[f, g] does return f[g], and that Compose[] has been obsolete for quite a while... $\endgroup$ Commented Apr 7, 2017 at 3:28
  • 4
    $\begingroup$ Composition[f, g][x] evaluates to x^6 $\endgroup$
    – Bob Hanlon
    Commented Apr 7, 2017 at 6:43
  • $\begingroup$ While that question is different, the answer explains the difference. We could close it as a duplicate then instead of as a simple mistake. Is there a name for #1@#2&? Let me know. $\endgroup$
    – Kuba
    Commented Apr 7, 2017 at 20:04
  • $\begingroup$ @Kuba Yes, that is very relevant. I have no strong opinion on duplicate vs not, so leave it to you. $\endgroup$
    – Igor Rivin
    Commented Apr 7, 2017 at 20:07
  • $\begingroup$ @IgorRivin thanks. Duplicates are never deleted while simple mistakes can be, unless they have a positive score. $\endgroup$
    – Kuba
    Commented Apr 7, 2017 at 20:11

0