12

Is is possible to write SyntaxInformation of "ArgumentsPattern" for functions of the form:

f[a,b][x,y,z]

That is, I get syntax coloring such that the first set of square braces takes exactly 2 arguments, and the second set takes 3?

I tried this:

SyntaxInformation[f[_, _]] = {"ArgumentsPattern" -> {_, _, _}}

But it doesn't take it

QuantumDot
  • 19,601
  • 7
  • 45
  • 121
  • 3
    I don't think so. It must always be defined as SyntaxInformation[f] = sompatterns and somepatterns need to follow a very restricted syntax (as documented). I think that's because they're interpreted by the front end, not the kernel. This is of course just an educated guess. +1 though, interesting question. – Szabolcs Nov 23 '14 at 19:59
  • Aw, that's too bad. Thanks for the info though.. – QuantumDot Nov 23 '14 at 21:09
  • @Szabolcs Would you kindly turn your comment into an answer? I'll accept and this question will go off the unanswered list. – QuantumDot Nov 19 '15 at 10:32
  • Sorry, I really don't want to. I asked a similar question where I was sure the answer would be "it's not possible" and it was possible in the end. There's no harm in leaving it unanswered. A developer from WRI might confirm that it is not possible or someone might actually find a solution. – Szabolcs Nov 19 '15 at 12:34

1 Answers1

5

This is not currently possible. The SyntaxInformation is set up to color "down values" (definitions of the form f[x_,y_] := ...), not "sub values" (definitons of the form f[x_][y_] := ...).

It's not a bad suggestion with the increase in operator forms.

Kuba
  • 136,707
  • 13
  • 279
  • 740
Itai Seggev
  • 14,113
  • 60
  • 84