Can anyone help me with why Area maps over a list when its attributes don't include Listable
Hi Thanks for all your interest. I have continued to scrabble about to find an answer to the problem (with no success). However just in case it helps. This must be a relatively recent change in Mathematica because the example is drawn from P. Wellin's book Essentials of Programming in Mathematica pub 2016 (which I am following in order to learn stuff). I've attached the clip which is in section 2.5 on Attributes. I tried it out and Plot worked just fine
c
Hi Chess,
I tried it on "11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)" and got the same error as in Wellin's book. No error on "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)". So this is a change introduced in v12. The documentation page for Area does say it was updated in 12.0 but I could not find any details about the specific changes.
Area
Rohit:
Good point. I missed that. But, in the case of Area[], I'm not yet convinced that that is what is going on here. But, I could be wrong.
The reason I don't think that is what is happening here is that some definitions of Area take lists as arguments. I think (but could definitely be wrong) that it would be difficult for the interpreter/compiler to disambiguate between "listable" arguments and arguments that are lists.
It would be great to hear from the Wolfram team on this one.
From the Properties & Relations section of the Listable documentation.
A function implemented in terms of a listable operation may not need the Listable attribute:
So, presumably Area uses listable functions and that is why it is listable even though it does not have the Listable attribute.
Listable
Thanks that was a silly transcribing error, but I still don't understand why the Area function is mapping happily over the list when, if you call its attributes they don't include Listable.
Hi Chess
You missed a comma between the two arguments of the Disk function
In[1]:= Area[{Disk[{0, 0}, r], Sphere[{0, 0, 0}, r]}] Out[1]= {ConditionalExpression[\[Pi] r^2, r > 0], ConditionalExpression[4 \[Pi] r^2, r > 0]}