1

I was just wondering if any programming language, organization, or computer scientist had ever given a name for the comma operator or equivalent separator when used in an array?

["Do", "the", "commas", "here", "have", "a", "name"]?

i.e. separators, next, continue, etc.?

dallin
  • 8,775
  • 2
  • 36
  • 41
  • It's not an operator. It's just a special character. Comma is an operator in some languages in other contexts. – user207421 Mar 06 '14 at 18:40
  • "Separator" is a fine term. But it really isn't that common to discuss this particular bit of syntax, so I doubt there's a common term. –  Mar 07 '14 at 00:08
  • @delnan Yeah, I agree it isn't commonly discussed. I'm working on a project where referring to it by a keyword when in a specific context might be clearer than using a comma, so I wanted to see if there was any precedence before I chose a term myself. – dallin Mar 08 '14 at 01:06
  • List separator would be the usual term in a grammar. Or just comma. – david.pfx Mar 08 '14 at 13:02

1 Answers1

3

As per the comments: the comma in the example is not an operator. It is a list separator and where it appears in a grammar it is typically referred to as list separator, separator or just `comma'.

It is used with this meaning and terminology in at least 90% of the languages I've used (which is quite a few). There are languages with different separators or additional separators, including white space or just about any punctuation character you can think of, but no original names for them as far as I recall.

I do not rule out the possibility that some creative person has called it something different. If not, feel free to be the first.

david.pfx
  • 10,520
  • 3
  • 30
  • 63
  • I would like to disagree, indeed. In certain languages (specially functional languages), this comma could be considered an operator: the "cons" operator. In LISP, lists are made of conses (see http://en.wikipedia.org/wiki/Cons). In Haskell, the list [1,2,3] stands for 1:(2:(3:Null))), and the `:` (written as `,`) is indeed a constructor, which you can think as an operator. – anumi Mar 11 '14 at 13:41
  • @anumi: According to this Haskell grammar [http://www.haskell.org/onlinereport/exps.html] the comma is a separator in a list or tuple and not an operator. The cons symbol is ':'. Commas are also used as separators in other parts of the grammar. – david.pfx Mar 12 '14 at 00:49
  • @anumi: As far as I am aware, Lisp does not use any separator for its lists. Comma has a narrow but unrelated role. I don't see this as a counter example, but please do keep looking. – david.pfx Mar 12 '14 at 00:58