Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Is there ever a case where two consecutive commas in not an error?
Replies: 3   Last Post: Mar 31, 2013 3:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Park

Posts: 1,560
Registered: 5/19/07
Re: Is there ever a case where two consecutive commas in not an error?
Posted: Mar 31, 2013 3:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


As it stands now there is nothing that prevents a programmer from using
successive commas as a valid expression.

{a, b, , c}

I use this as a shortcut method for representing ellipsis sequences in

<< Presentations`

iSum[a[i], {i, 1, 2, , n}]
a[1] + a[2] + \[CenterEllipsis] + a[n]

iSum[a[i], {i, 1, 2, , k, Null}]
a[1] + a[2] + \[CenterEllipsis] +a[k] + \[CenterEllipsis]

(Except here the FullForm output is actually in an iSum wrapper and some
manipulation can be done on the expression, or it can be converted to a
normal Sum. Special measures have to be taken to make certain the terms are
not reordered or combined.)

Perhaps Null is not the best choice here, but it is the easiest and most
natural method for entering such expressions.

David Park

From: W Craig Carter [mailto:ccarter@MIT.EDU]

I am wondering if there is ever a case where ",," is not an error.
For example, I make syntax errors like this:


very often, and searching for them would be easier with highlighting.

If ",," is never not an error, shouldn't it be a candidate for error syntax
(or, If ",," is always an error, it should be a candidate for error syntax

Craig Carter

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.