1
$\begingroup$

I am using Mathematica 11.3.0.0, 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:

Questions

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

$\endgroup$
3
  • 2
    $\begingroup$ 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. $\endgroup$ Commented Sep 23, 2018 at 19:41
  • 1
    $\begingroup$ SyntaxInformation[Circle] gives {"ArgumentsPattern" -> {Optional[{_, _}], _., Optional[{_, _}]}}. That is, the first argument (if it is used) should be a list of two elements. $\endgroup$
    – kglr
    Commented Sep 23, 2018 at 19:41
  • 3
    $\begingroup$ Please do not use the bug tag unless it is confirmed by support or community. $\endgroup$
    – Kuba
    Commented Sep 23, 2018 at 19:41

2 Answers 2

4
$\begingroup$
SyntaxInformation[Circle] 

{"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.

$\endgroup$
1
$\begingroup$

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.

Related:

Why is this semicolon in red?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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