Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Composition, RightComposition, design decisions

Posted 11 years ago
POSTED BY: Szabolcs Horvát
4 Replies
POSTED BY: Szabolcs Horvát
POSTED BY: Daniel Lichtblau
Posted 11 years ago

Indeed, 4 ways to get the same result. But what's wrong with that? Is Mathematica not famous for having several ways to achieve the same end result? But with thousands of functions and more coming, it gets really crowded. especially in our limited human memory...

In[16]:= Composition[f, g, h][x]
f@*g@*h@x
RightComposition[h, g, f][x]
h /* g /* f@x

Out[16]= f[g[h[x]]]

Out[17]= f[g[h[x]]]

Out[18]= f[g[h[x]]]

Out[19]= f[g[h[x]]]

The same for RightComposition:

In[27]:= RightComposition[f, g, h][x]
f /* g /* h@x
Composition[h, g, f][x]
h@*g@*f@x

Out[27]= h[g[f[x]]]

Out[28]= h[g[f[x]]]

Out[29]= h[g[f[x]]]

Out[30]= h[g[f[x]]]
POSTED BY: Erik Mahieu
POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard