Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13962 > unrolled thread
| Started by | W Craig Carter <ccarter@MIT.EDU> |
|---|---|
| First post | 2013-03-30 08:06 +0000 |
| Last post | 2013-04-01 04:56 +0000 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Is there ever a case where two consecutive commas in not an error? W Craig Carter <ccarter@MIT.EDU> - 2013-03-30 08:06 +0000
Re: Is there ever a case where two consecutive commas in not an error? debguy <johnandsara2@cox.net> - 2013-03-31 07:10 +0000
Re: Is there ever a case where two consecutive commas in not an error? Peter Pein <petsie@dordos.net> - 2013-03-31 07:11 +0000
Re: Is there ever a case where two consecutive commas in not an error? Helen Read <readhpr@gmail.com> - 2013-03-31 07:11 +0000
Re: Is there ever a case where two consecutive commas in not an error? debguy <johnandsara2@cox.net> - 2013-04-01 04:57 +0000
Re: Is there ever a case where two consecutive commas in not an error? David Reiss <dbreiss@gmail.com> - 2013-04-01 04:56 +0000
| From | W Craig Carter <ccarter@MIT.EDU> |
|---|---|
| Date | 2013-03-30 08:06 +0000 |
| Subject | Is there ever a case where two consecutive commas in not an error? |
| Message-ID | <kj66el$ogj$1@smc.vnet.net> |
Hello,
I am wondering if there is ever a case where ",," is not an error.
For example, I make syntax errors like this:
Plot[x,{x,0,1},ImageSize->Large,BaseStyle->Large,PlotRange->{All,{0,2}},,PlotLabel->"label",Epilog->Line[{{0,0},{1,.5}}]]
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 highlighting?
(or, If ",," is always an error, it should be a candidate for error syntax highlighting)
Craig Carter
[toc] | [next] | [standalone]
| From | debguy <johnandsara2@cox.net> |
|---|---|
| Date | 2013-03-31 07:10 +0000 |
| Message-ID | <kj8ngl$1qg$1@smc.vnet.net> |
| In reply to | #13962 |
no it's valid syntax {,,} is {Null,Null,Null} and always has been:
changing it would break all previous software using it correctly
as far as highlighting ? highlight it if you want to
[toc] | [prev] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2013-03-31 07:11 +0000 |
| Message-ID | <kj8nif$1rq$1@smc.vnet.net> |
| In reply to | #13962 |
Am 30.03.2013 09:06, schrieb W Craig Carter:
> Hello,
> I am wondering if there is ever a case where ",," is not an error.
> For example, I make syntax errors like this:
>
> Plot[x,{x,0,1},ImageSize->Large,BaseStyle->Large,PlotRange->{All,{0,2}},,PlotLabel->"label",Epilog->Line[{{0,0},{1,.5}}]]
>
> 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 highlighting?
> (or, If ",," is always an error, it should be a candidate for error syntax highlighting)
>
> Craig Carter
>
>
>
>
>
>
Hi,
strange enough in
In[1]:= If[{,,} === ConstantArray[Null, 3], "no err"]
Out[1]= "no err"
the double comma apears highlighted :)
[toc] | [prev] | [next] | [standalone]
| From | Helen Read <readhpr@gmail.com> |
|---|---|
| Date | 2013-03-31 07:11 +0000 |
| Message-ID | <kj8nil$1rs$1@smc.vnet.net> |
| In reply to | #13962 |
I don't think it's always an error. For example, you can have a list
with empty entries. This happens a lot when I import Excel files. If
there are empty cells in the spreadsheet, you get ",,"
Now, in a Plot it might always be an error, but it isn't generally.
Helen Read
University of Vermont
On 3/30/2013 4:06 AM, W Craig Carter wrote:
> Hello,
> I am wondering if there is ever a case where ",," is not an error.
> For example, I make syntax errors like this:
>
> Plot[x,{x,0,1},ImageSize->Large,BaseStyle->Large,PlotRange->{All,{0,2}},,PlotLabel->"label",Epilog->Line[{{0,0},{1,.5}}]]
>
> 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 highlighting?
> (or, If ",," is always an error, it should be a candidate for error syntax highlighting)
>
> Craig Carter
>
>
>
>
>
>
[toc] | [prev] | [next] | [standalone]
| From | debguy <johnandsara2@cox.net> |
|---|---|
| Date | 2013-04-01 04:57 +0000 |
| Message-ID | <kjb435$8je$1@smc.vnet.net> |
| In reply to | #13979 |
"As it stands now there is nothing that prevents a programmer from using successive commas as a valid expression. " who is xxx to say that they've done any good "preventing me" from using more than one comma? it's bad practice to make senseless preference changes that break perfectly valid code what now everybody go back to all their notebooks and look for that everywhere? bad. Mathematica is great and one thing that makes it that way is it's portability and longevity. Having new editors thinking they god "helping" us by enforcing their own preference is not good news. Hey how about change the preferences on the arguements to Plus. Just break it all :)
[toc] | [prev] | [next] | [standalone]
| From | David Reiss <dbreiss@gmail.com> |
|---|---|
| Date | 2013-04-01 04:56 +0000 |
| Message-ID | <kjb42l$8j8$1@smc.vnet.net> |
| In reply to | #13962 |
Although, as others have pointed out already a double comma may not be
a syntactically incorrect form in many circumstances (i.e., Null in
between the commas has meaning), it certainly is often a source of a
bug that is hard to track down. I believe that Workbench highlights
double commas (correct me if I am wrong) just for this reason.
On Mar 30, 4:06 am, W Craig Carter <ccar...@MIT.EDU> wrote:
> Hello,
> I am wondering if there is ever a case where ",," is not an error.
> For example, I make syntax errors like this:
>
> Plot[x,{x,0,1},ImageSize->Large,BaseStyle->Large,PlotRange->{All,{0,2}},,Pl otLabel->"label",Epilog->Line[{{0,0},{1,.5}}]]
>
> 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 highlighting?
> (or, If ",," is always an error, it should be a candidate for error syntax highlighting)
>
> Craig Carter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web