I am using Mathematica, 64 bit.

Here is my code:

Graphics[Thread[Circle[{{-1, 0}, {0, 0}, {1, 0}}, {0.5, 1.0, 0.5}]]]

Here is code as it looks in a notebook:

On mouseover on , {1, 0}:

However, when I evaluate that code I am getting the right output:


Why, although is , {1, 0} colored in red, does the expression evaluate correctly? Is it a bug? Or maybe I am doing something wrong?

  • 2
    Everything is fine. That's just the syntax highlighter. If it makes you feel better, you can use MapThread[Circle, {{{-1, 0}, {0, 0}, {1, 0}}, {0.5, 1.0, 0.5}}] instead. – Henrik Schumacher Sep 23 at 19:41
  • 1
    SyntaxInformation[Circle] gives {"ArgumentsPattern" -> {Optional[{_, _}], _., Optional[{_, _}]}}. That is, the first argument (if it is used) should be a list of two elements. – kglr Sep 23 at 19:41
  • 3
    Please do not use the bug tag unless it is confirmed by support or community. – Kuba Sep 23 at 19:41

{"ArgumentsPattern" -> {Optional[{_, _}], ., Optional[{, _}]}}

That is, the first argument (if it is used) should be a list with two elements. Hence, the excess arguments are colored red by the syntax highlighter.

Is Circle[{{-1, 0}, {0, 0}, {1, 0}}, {0.5, 1.0, 0.5}] a valid input? I hope it is clear it is not.

Will Thread[Circle[{{-1, 0}, {0, 0}, {1, 0}}, {0.5, 1.0, 0.5}]] evaluate to something reasonable? It will but you don't want the FrontEnd to evaluate your code behind the hood to determine this (and of course it doesn't do this!). Consider consequences if that was something less trivial.


Why is this semicolon in red?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.