Acorn Arcade forums: Programming: There's a triple-dot ellipsis in C!
|
There's a triple-dot ellipsis in C! |
|
Stoppers (06:27 3/6/2008) filecore (06:39 3/6/2008) Stoppers (07:23 3/6/2008)
|
|
Simon Willcocks |
Message #107549, posted by Stoppers at 06:27, 3/6/2008 |
Member
Posts: 302
|
Has that always been there, or is it something new?
I've been writing C since the mid eighties and never noticed it!
switch (i) { case 1...54: whatever } |
|
[ Log in to reply ] |
|
Jason Togneri |
Message #107550, posted by filecore at 06:39, 3/6/2008, in reply to message #107549 |
Posts: 3868
|
I was beginning to wonder, I've never seen an ellipsis without triple dots. Are you the sort of person who also says Personal PIN Number? |
|
[ Log in to reply ] |
|
Simon Willcocks |
Message #107551, posted by Stoppers at 07:23, 3/6/2008, in reply to message #107550 |
Member
Posts: 302
|
I started out early on with Pascal, which uses two dots for ranges of values but, iirc, it was still called an ellipsis. (I can't find any Pascal or Modula-2 textbooks to check.)
It's like spelling computer program in the american way, just a convention I've got used to.
Anyway, I knew (but forgot) about its use as a placeholder for extra parameters (a strange feature I've only ever used in printf, etc.).
The usage I'd not seen before was in switch statements (and looking at Stroustrup, third edition, it doesn't seem to be a long time feature of C++, at least). I don't have any C language manuals around because I know it all!
I don't talk about PINs, but I've been known to use the verb "to InterRail" - it's my language and I can do what I damn well please with it!
[Edit: Yay, I'm not completely mad!] http://en.wikipedia.org/wiki/Ellipsis "In some programming languages (including Perl, Ruby, and Pascal), a shortened two-dot ellipsis is used to represent a range of values given two endpoints[...]"
The case range thing is a gcc extension to C.
[Edited by Stoppers at 10:53, 3/6/2008] |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: There's a triple-dot ellipsis in C! |