Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
3 deleted 445 characters in body; edited tags; edited title
source | link

Why Is there is noa name for #1@#2&?

Why does the pure function #1@#2&# @ #2 & have no name? Is it due to the way Mathematica works, or is it "just because"?

I'm asking because sometimes I find inelegant to write expressions like

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather have a name form such as

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?

Why there is no name for #1@#2&?

Why does the pure function #1@#2& have no name? Is it due to the way Mathematica works, or is it "just because"?

I'm asking because I find inelegant to write expressions like

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather have a name form such as

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?

Is there a name for #1@#2&?

Why does the pure function # @ #2 & have no name?

I'm asking because sometimes I find inelegant to write expressions like

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather have a name form such as

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 
2 Made English clearer and more idiomatic
source | link

Why there is no name for #1@#2&? Is it due to the way Mathematica works?

... Why does the pure function #1@#2& have no name? Is it due to the way Mathematica works, or is it "just because"?

I'm asking because I find inelegant to write, lets take an example from Chat: expressions like

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather choosehave a name form: such as

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?

Why there is no name for #1@#2&? Is it due to the way Mathematica works?

... or is it "just because"?

I'm asking because I find inelegant to write, lets take an example from Chat:

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather choose a name form:

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?

Why there is no name for #1@#2&?

Why does the pure function #1@#2& have no name? Is it due to the way Mathematica works, or is it "just because"?

I'm asking because I find inelegant to write expressions like

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather have a name form such as

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?
    Tweeted twitter.com/#!/StackMma/status/357869266621575169
1
source | link

Why there is no name for #1@#2&? Is it due to the way Mathematica works?

... or is it "just because"?

I'm asking because I find inelegant to write, lets take an example from Chat:

MapThread[#@#2 &, {{a, b, c}, {1, 2, 3}}]
{a[1], b[2], c[3]}

I would rather choose a name form:

MapThread[Work, {{a, b, c}, {1, 2, 3}}] 

Work is not the best choice but I'm open on suggestions :)

  • One may say that there is no name because #1@#2& is short enough. But f/@{1,2,3} is shorter than Map[f,{1,2,3}] and Map exists :)
  • Then I've thought, maybe it is because Map gives other possibilities with 3rd argument and this is the difference. Well, it is a difference, but so what, why ther is no Work?