Linked Questions

76 votes
3 answers
6k views

when is f@g not the same as f[g]?

I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use ...
Nasser's user avatar
  • 145k
37 votes
3 answers
3k views

How to Combine Pattern Constraints and Default Values for Function Arguments?

EDIT: As several respondents have noted in the answers and comments below, the original example had a default value that would never be used because of the way patterns and default values are ...
StackExchanger's user avatar
30 votes
3 answers
1k views

Parentheses in pure functions: # & vs. ( # &)

I've been using Mathematica for years, and over time I have developed the habit of using: Select[data, (# == 1 &)] instead of ...
Eric Brown's user avatar
  • 4,426
24 votes
3 answers
1k views

How can I get the unchanged Box form of an arbitrary expression?

One may observe that MakeBoxes does not give the actual Box form of various expressions: MakeBoxes[{1*^4, 000123, a*b c}] <...
Mr.Wizard's user avatar
  • 272k
18 votes
1 answer
1k views

Is there a guideline about when to end expressions with semicolons?

Whether for nested Ifs or within scoping constructs like Module and Block, I never know ...
Andrew Cheong's user avatar
17 votes
3 answers
580 views

What is the real default CellEvaluationFunction?

The default CellEvaluationFunction is Identity but one can quickly see that this is handled specially as an equivalent function, ...
Mr.Wizard's user avatar
  • 272k
15 votes
2 answers
606 views

Infix form of PutAppend ( >>> ) does not work with variable

I'm new to Mathematica, so I suspect this question involves either a misunderstanding involving variables or the usage of >>>. On a webMathematica page (...
Daniel's user avatar
  • 825
9 votes
3 answers
202 views

Metaquestion: how to find out why (e.g.) MatchQ[42, _?Function[x, True]] is False?

Suppose you run into a bewildering Mathematica result (which happens to me several times per Mathematica session, even after a 20-year acquaintance), such as, for example: ...
kjo's user avatar
  • 11.7k
9 votes
1 answer
254 views

Bug in grouping after editing code?

Bug introduced in 7.0 or earlier and persisting through 11.0 While looking at A question about conditional replacement I think I discovered a bug in the Front End that affects both 7.0.1 and 10.0.1 ...
Mr.Wizard's user avatar
  • 272k
6 votes
1 answer
186 views

create function that behaves like continuedFraction [duplicate]

I'm just starting to learn Mathematica and I got stuck at this question. This a noob question but please help. I need to define a function named continuedFraction that takes user input of type list ...
momokjaaaaa's user avatar
5 votes
2 answers
275 views

Associativity of `/@` [duplicate]

Why are the following not equivalent: Map[Line, Map[(Print[#]; #) &, {{{2, 1}, {1, 1}}, {{-2, 1}, {3, 1}}}]] which produces ...
d125q's user avatar
  • 437
5 votes
2 answers
292 views

Nested mapping of a function

If I use the construct f[#] & /@ f[#] & /@ f[#] & /@ {a, b, c} my function works, but if I use ...
martin's user avatar
  • 8,708
4 votes
1 answer
250 views

Association of pure functions [duplicate]

I've encountered confusing behavior of Association when I try to use it for storing pure functions. For example: as = <|"1" -> # + 1 &|> ...
iav's user avatar
  • 2,016
4 votes
1 answer
532 views

How to see abstract syntax tree of Wolfram Language expression

I mean, suppose I have this expression: 2 + 2 I want to get something like this: Plus[2, 2] as an output. I've tried FullForm, but this just evaluates 2+2 and returns 4. Is this even possible?
Ezo's user avatar
  • 43
3 votes
4 answers
1k views

Extracting RHS from Rule

In an example from another question, the rhs of a list of rules can be simply extracted: ...
ebergerson's user avatar

15 30 50 per page