www.digitalmars.com         C & C++   DMDScript  

D - semicolons

reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I would like to humbly ask that semicolons not be mandatory statement
separators in D, but that they be equivalent to newline, and that newline is
a potential statement separator, semicolon is a definite one, and semicolon
+ newline is treated as only one separation.

if (ihadacoollanguage)
{
  int a = b + c
  int k = b + c +
             d + e   // these don't count because they don't parse in the
same places comma and semicolon do.
  int j = b + c
            + d + e  // it actually has to be looking for a comma or
semicolon for a newline to work instead
  // or it at least needs the remaining fragment to not to compile without
treating the eoline as a terminator
  char[]
     thisstillworkshowever(char[]a,  // comma is ok, it's just not necessary
                                      char[]b // comma optional because
there's a newline instead
                                      char[]c;  // semi optional where comma
is accepted?
                                      char[]d);
}

I mean, I would like my compiler to not pick nits about semicolons.  If I
forget one, so friggin what it usually doesn't matter... the compiler has
figured it out that it indeed was a missing semicolon big friggin deal, just
deal with it and move on.  It should be a warning at best.  In order for the
compiler to figure out that a semicolon is missing, it is known that a
semicolon must be inserted to fix the problem, but since that's a legal fix
it should just do it.

It's like real english, sometimes you Dot all you're P"s and q's and
someTimes you don't, and yes the code would be nicer if you did all your
grammar homework or weren't lazy it's not crucial to get the point across.
Allowing slop in syntax allows one to do quick "phrasing" while blocking out
the code and clean up the subtle issues later. (if this ever becomes an
issue because maybe the program works perfectly as written)  Sometimes you
just wanna test something quickly and do some cut'n'paste and the last thing
you want to see is some stupid "you forgot a semicolon" problems.

Yes I realize it would maybe create a few bugs;  about as many as for(;;);
has.  Number of bugs created by a construct is proportional to the number of
times that construct is used by someone.  Useful constructs will inherently
generate more bugs up to a point.

Sean
Jun 09 2002
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:advgr5$2seb$1 digitaldaemon.com...
 I would like to humbly ask that semicolons not be mandatory statement
 separators in D, but that they be equivalent to newline, and that newline
is
 a potential statement separator, semicolon is a definite one, and
semicolon
 + newline is treated as only one separation.
It is a good idea, and it is implemented in Javascript. Unfortunately, it turns out to be problematic in practice. It's hard to write a grammar that accurately represents the behavior, and it can lead to troublesome error messages, etc. I worry about putting it in, and it making enhancements to the language impractical (like >> makes template argument lists a problem in C++).
Jun 09 2002
parent reply "Robert W. Cunningham" <rcunning acm.org> writes:
Walter wrote:

 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:advgr5$2seb$1 digitaldaemon.com...
 I would like to humbly ask that semicolons not be mandatory statement
 separators in D, but that they be equivalent to newline, and that newline
is
 a potential statement separator, semicolon is a definite one, and
semicolon
 + newline is treated as only one separation.
It is a good idea, and it is implemented in Javascript. Unfortunately, it turns out to be problematic in practice. It's hard to write a grammar that accurately represents the behavior, and it can lead to troublesome error messages, etc. I worry about putting it in, and it making enhancements to the language impractical (like >> makes template argument lists a problem in C++).
Agreed. I can't come up with a good example at the moment (Sunday afternoon lethargy), but I'm certain the use of CR or LF or CRLF or LFCR or whatever as a valid statement separator would lead to problems with quoting, and would lead to a proliferation of backslashes in code and/or string constants/literals. Or not. I'll think about it some more when my brain turns back on tomorrow... -BobC
Jun 09 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Robert W. Cunningham" <rcunning acm.org> wrote in message
news:3D03F538.B8911A2D acm.org...
 I can't come up with a good example at the moment (Sunday afternoon
lethargy),
 but I'm certain the use of CR or LF or CRLF or LFCR or whatever as a valid
 statement separator would lead to problems with quoting, and would lead to
a
 proliferation of backslashes in code and/or string constants/literals.
If you have a long expression broken up across multiple lines, with the automatic ; insertion, it can produce unexpected results. The grammar being difficult to specify also makes it hard to explain, so less experienced programmers will be likely to have trouble with it. C's simple rule, put a ; at the end of each statement, is easy to get right. Sure it's redundant, but error detection and diagnosis is *entirely* dependent on redundancy in the grammar. The right amount of redundancy is not too onerous, and makes error detection and accurate error messages possible for common mistakes. There are other examples of redundancy in D: the () in an if statement. The closing ) of a parenthesized expression. The comma between function parameters. It goes on and on...
Jun 09 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
If the compiler is smart enough to figure out there *should* be a semicolon
here, why not automatically insert one?

Sean

"Walter" <walter digitalmars.com> wrote in message
news:ae14em$1cvl$1 digitaldaemon.com...
 "Robert W. Cunningham" <rcunning acm.org> wrote in message
 news:3D03F538.B8911A2D acm.org...
 I can't come up with a good example at the moment (Sunday afternoon
lethargy),
 but I'm certain the use of CR or LF or CRLF or LFCR or whatever as a
valid
 statement separator would lead to problems with quoting, and would lead
to
 a
 proliferation of backslashes in code and/or string constants/literals.
If you have a long expression broken up across multiple lines, with the automatic ; insertion, it can produce unexpected results. The grammar
being
 difficult to specify also makes it hard to explain, so less experienced
 programmers will be likely to have trouble with it. C's simple rule, put a
;
 at the end of each statement, is easy to get right. Sure it's redundant,
but
 error detection and diagnosis is *entirely* dependent on redundancy in the
 grammar. The right amount of redundancy is not too onerous, and makes
error
 detection and accurate error messages possible for common mistakes.

 There are other examples of redundancy in D: the () in an if statement.
The
 closing ) of a parenthesized expression. The comma between function
 parameters. It goes on and on...
Jun 10 2002
next sibling parent andy <acoliver apache.org> writes:
I like the semicolons, I think they're pretty.

-Andy

Sean L. Palmer wrote:
 If the compiler is smart enough to figure out there *should* be a semicolon
 here, why not automatically insert one?
 
 Sean
 
 "Walter" <walter digitalmars.com> wrote in message
 news:ae14em$1cvl$1 digitaldaemon.com...
 
"Robert W. Cunningham" <rcunning acm.org> wrote in message
news:3D03F538.B8911A2D acm.org...

I can't come up with a good example at the moment (Sunday afternoon
lethargy),
but I'm certain the use of CR or LF or CRLF or LFCR or whatever as a
valid
statement separator would lead to problems with quoting, and would lead
to
a

proliferation of backslashes in code and/or string constants/literals.
If you have a long expression broken up across multiple lines, with the automatic ; insertion, it can produce unexpected results. The grammar
being
difficult to specify also makes it hard to explain, so less experienced
programmers will be likely to have trouble with it. C's simple rule, put a
;
at the end of each statement, is easy to get right. Sure it's redundant,
but
error detection and diagnosis is *entirely* dependent on redundancy in the
grammar. The right amount of redundancy is not too onerous, and makes
error
detection and accurate error messages possible for common mistakes.

There are other examples of redundancy in D: the () in an if statement.
The
closing ) of a parenthesized expression. The comma between function
parameters. It goes on and on...
Jun 10 2002
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ae2rju$9f4$1 digitaldaemon.com...
 If the compiler is smart enough to figure out there *should* be a
semicolon
 here, why not automatically insert one?
Because although that's what the error messages says, it's actually just a guess that that is what the programmer most likely intended.
Jun 10 2002
parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
Right, if you drop semicolons, then the following code is legal

    int a,b;
    int c = b+
    a = a+b

The compiler would interpret it as:
    int a,b;
    int c = b + ( a = a + b);
But probably the programmer actually just made a typo, and meant
    int a,b;
    int c = b++;
    a = a + b;



Walter wrote:

 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:ae2rju$9f4$1 digitaldaemon.com...
 If the compiler is smart enough to figure out there *should* be a
semicolon
 here, why not automatically insert one?
Because although that's what the error messages says, it's actually just a guess that that is what the programmer most likely intended.
-- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Jun 11 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Someone *could* write this:

int a;b,

int c = b+;
a = a ++ b;

Now what the hell does *that* do?  And how is that any more or less likely
than forgetting a semicolon?

Did the programmer forget a +?  Did the programmer really mean the ++?  Or
did he mean binary and unary plus?  Is the ++ postfix increment of a or
prefix increment of b?

There's any number of ways to write code wrong; many of those are actually
legal and compilable.

I personally don't see much benefit from mandating semicolons.

Sean


"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
news:3D0628E5.B02592D4 deming-os.org...
 Right, if you drop semicolons, then the following code is legal

     int a,b;
     int c = b+
     a = a+b

 The compiler would interpret it as:
     int a,b;
     int c = b + ( a = a + b);
 But probably the programmer actually just made a typo, and meant
     int a,b;
     int c = b++;
     a = a + b;
Jun 11 2002
parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
"Sean L. Palmer" wrote:

 Someone *could* write this:

 int a;b,

 int c = b+;
 a = a ++ b;

 Now what the hell does *that* do?  And how is that any more or less likely
 than forgetting a semicolon?
Sounds like my previous post sounded like a flame. I'm sorry - I certainly didn't mean it that way. What I was trying to illustrate was that a simple typo resulted in legal - but unintended code. I thought that the example was useful because at first I was going to agree with you. However, when the counterexample crossed my mind, I changed my opinion. For that reason, I thought that it was a good way to illustrate my (changed) opinion. My argument is just a variant of Walter's old argument: "If any binary stream of data is a valid code, then there are no syntax errors. Syntax errors give you a simple sanity check to catch (some of the) invalid code." I think that semicolons do remarkably well in that role. Again, sorry for any flamish posts... -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Jun 11 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I'm not taking anything as flame (that's just how I react occasionally.  ;)
I didn't mean my post as reactionary or flame either;  sorry if you took it
that way.

Oh well I can live with semicolons.  Not a big deal.  It's better than
having to surround every statement with parenthesis or braces.

I just wish the IDE/Editor performed more of these functions.  The
text-based nature of programming languages is getting me down lately.  A
smart IDE can detect errors as you type, and could auto-indent, as well as,
say, draw barely-visible boxes around each statement or whatever.

You could program in a sort of boxes, plugs, and sockets view; a kind of
data flow graph.  Maybe toggle back and forth between that and text view.
Or to a class hierarchy view.  The raw text view is so restrictive and
antiquated in comparison.  One could make a programming language that didn't
use text at all if you tried.

What's really important in a language (to me) is the conceptual
relationships between its elements. What gets what to do what with what.

Sean

"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
news:3D065180.651B3109 deming-os.org...
 "Sean L. Palmer" wrote:

 Someone *could* write this:

 int a;b,

 int c = b+;
 a = a ++ b;

 Now what the hell does *that* do?  And how is that any more or less
likely
 than forgetting a semicolon?
Sounds like my previous post sounded like a flame. I'm sorry - I
certainly
 didn't mean it that way.

 What I was trying to illustrate was that a simple typo resulted in legal -
but
 unintended code.  I thought that the example was useful because at first I
was
 going to agree with you.  However, when the counterexample crossed my
mind, I
 changed my opinion.  For that reason, I thought that it was a good way to
 illustrate my (changed) opinion.

 My argument is just a variant of Walter's old argument: "If any binary
stream
 of data is a valid code, then there are no syntax errors.  Syntax errors
give
 you a simple sanity check to catch (some of the) invalid code."  I think
that
 semicolons do remarkably well in that role.

 Again, sorry for any flamish posts...
Jun 11 2002
next sibling parent reply Karl Bochert <kbochert ix.netcom.com> writes:
 
 I just wish the IDE/Editor performed more of these functions.  The
 text-based nature of programming languages is getting me down lately.  A
 smart IDE can detect errors as you type, and could auto-indent, as well as,
 say, draw barely-visible boxes around each statement or whatever.
The editor I use, Epsilon, does automatic indenting, and I find it invaluable. Many errors are caught when the editor indents strangely due to a missing semicolon, dangling else etc. It seems to me that I have seen an editor that marks the extent of blocks in the left margin. You're right though -- much more could be done.
Jun 12 2002
next sibling parent reply "Andrew" <crxace13 comcast.net> writes:
Epsilon comes with the source code, so it could be extended to support D.
Though I'm not capable of doing such a thing! I'm sure someone in this
newsgroup is!

"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1023868581 bose...
| >
| > I just wish the IDE/Editor performed more of these functions.  The
| > text-based nature of programming languages is getting me down lately.
A
| > smart IDE can detect errors as you type, and could auto-indent, as well
as,
| > say, draw barely-visible boxes around each statement or whatever.
|
| The editor I use,  Epsilon, does automatic indenting, and I find it
invaluable.
| Many errors are caught when the editor indents strangely due to a missing
| semicolon,  dangling else etc. It seems to me that I have seen an editor
that
| marks the extent of blocks in the left margin. You're right though --
much
| more could be done.
|
|
Jun 12 2002
parent reply Karl Bochert <kbochert ix.netcom.com> writes:
On Wed, 12 Jun 2002 09:03:36 -0400, "Andrew" <crxace13 comcast.net> wrote:
 Epsilon comes with the source code, so it could be extended to support D.
 Though I'm not capable of doing such a thing! I'm sure someone in this
 newsgroup is!
 
Is the only difference between C and D (rom the editor's point of view!) a different list of keywords to be colored? The hard part is automatic indenting, and comments. Aren't C and D just abot the same there? The first step would be to see where the C module comes up short when doing D files.
Jun 12 2002
parent "Pavel Minayev" <evilone omen.ru> writes:
"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1023942917 bose...

 Is the only difference between C and D (rom the editor's point of view!) a
 different list of keywords to be colored?  The hard part is automatic
indenting,
 and comments. Aren't C and D just abot the same there?
Yes, only D also have /+ +/ comments in addition to /* */
Jun 13 2002
prev sibling next sibling parent "Andrew" <crxace13 comcast.net> writes:
Evaluation version of Epsilon for:

WinDoze:    http://www.lugaru.com/cgi-bin/send/eval/e11eval.exe

Linux:
http://www.lugaru.com/cgi-bin/send/eval/epsilon11eval.tar.gz

FreeBSD    http://www.lugaru.com/cgi-bin/send/eval/epsilon11eval-bsd.tar.gz

OS/2            http://www.lugaru.com/cgi-bin/send/eval/e11os2.zip
Jun 12 2002
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1023868581 bose...
 The editor I use,  Epsilon, does automatic indenting, and I find it
invaluable.
 Many errors are caught when the editor indents strangely due to a missing
 semicolon,  dangling else etc. It seems to me that I have seen an editor
that
 marks the extent of blocks in the left margin. You're right though -- much
 more could be done.
The kinds of errors I worry about aren't syntax errors that quickly get caught by the compiler, but subtle semantic ones. D is designed to make it easier to catch those.
Jun 13 2002
parent andy <acoliver apache.org> writes:
Walter wrote:
 "Karl Bochert" <kbochert ix.netcom.com> wrote in message
 news:1103_1023868581 bose...
 
The editor I use,  Epsilon, does automatic indenting, and I find it
invaluable.
Many errors are caught when the editor indents strangely due to a missing
semicolon,  dangling else etc. It seems to me that I have seen an editor
that
marks the extent of blocks in the left margin. You're right though -- much
more could be done.
The kinds of errors I worry about aren't syntax errors that quickly get caught by the compiler, but subtle semantic ones. D is designed to make it easier to catch those.
I like the semicolons.. they're pretty.
Jun 14 2002
prev sibling next sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ae6ql5$1c6h$1 digitaldaemon.com...

 Oh well I can live with semicolons.  Not a big deal.  It's better than
 having to surround every statement with parenthesis or braces.
Heh! =)
Jun 12 2002
prev sibling next sibling parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
"Sean L. Palmer" wrote:

 Oh well I can live with semicolons.  Not a big deal.  It's better than
 having to surround every statement with parenthesis or braces.
Or whitespace, like some languages. :) Heck, in Korn shell (I think bash is the same), these two lines are different: if [[ $a="asdf" ]]; then if [[ $a = "asdf" ]]; then The first is a syntax error because it tries to do an assignment in the test...the second is a legal comparison. :(
 I just wish the IDE/Editor performed more of these functions.  The
 text-based nature of programming languages is getting me down lately.  A
 smart IDE can detect errors as you type, and could auto-indent, as well as,
 say, draw barely-visible boxes around each statement or whatever.

 You could program in a sort of boxes, plugs, and sockets view; a kind of
 data flow graph.  Maybe toggle back and forth between that and text view.
 Or to a class hierarchy view.  The raw text view is so restrictive and
 antiquated in comparison.  One could make a programming language that didn't
 use text at all if you tried.

 What's really important in a language (to me) is the conceptual
 relationships between its elements. What gets what to do what with what.
Amen! Hoorah! Preach on, brother! I love D, and plan to use it as my only practical language (once the Linux version comes out) - but I have a number of ideas simmering in the back of my mind about what a language *should* be. On a somewhat related note, I've often thought that it would be nice to embed various types of documents into my source code. For instance, what if your comment could be in the form of a document from a word processor, inlined into the source document? Or what if, instead of having a big block of constants to initialize an array of structures, you could inline a spreadsheet and have the rows from the spreadsheet be the various array elements? Stuff like that. -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Jun 12 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 On a somewhat related note, I've often thought that it would be nice to
embed
 various types of documents into my source code.  For instance, what if
your
 comment could be in the form of a document from a word processor, inlined
into
 the source document?  Or what if, instead of having a big block of
constants to
 initialize an array of structures, you could inline a spreadsheet and have
the
 rows from the spreadsheet be the various array elements?  Stuff like that.
Coolness. You could initialize a string from a hyperlink to a text file or a word processor document. Have a function take a bitmap as an argument, but a hyperlink to a bitmap file on disk would work too (the compiler generates the call to the "load bitmap file from disk" function to convert it). But you're talking about embedding via OLE. Hmm...
Jun 12 2002
parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
"Sean L. Palmer" wrote:

 "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 On a somewhat related note, I've often thought that it would be nice to
embed
 various types of documents into my source code.  For instance, what if
your
 comment could be in the form of a document from a word processor, inlined
into
 the source document?  Or what if, instead of having a big block of
constants to
 initialize an array of structures, you could inline a spreadsheet and have
the
 rows from the spreadsheet be the various array elements?  Stuff like that.
Coolness. You could initialize a string from a hyperlink to a text file or a word processor document. Have a function take a bitmap as an argument, but a hyperlink to a bitmap file on disk would work too (the compiler generates the call to the "load bitmap file from disk" function to convert it). But you're talking about embedding via OLE. Hmm...
My original vision was OLE-esque. But the hyperlink idea works, too. Your IDE could expand the hyperlink (if you so desired) to display the included document inline without putting an OLE-reading requirement on the compiler. Heck, if you used hyperlinks, you could be referencing stuff accessible through HTTP, FTP, or whatever. Leads to some interesting possibilities for cooperative development - especially if you can import http files as well! -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Jun 12 2002
prev sibling next sibling parent reply "anderson" <anderson firestar.com.au> writes:
PCgrasp draws boxes and things around code as you type. I always turn it of
because It annoys me. Any how PCgrasp is lacking in many other areas.

I am considering writting a D focused IDE if I get some time. I would like
to make it UML focused, like rational rose (or visual modeler) but simpler
and with all the programming IDE stuff as well. I'd make it strongly reliant
on plugs so that I won't need to write everything and so users could
customise it.

I would probably have to do it in C++ not D because it supports extenable
controls that are in MFC, which win32 doesn't (but I may be wrong). Or is
there another way?



"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ae6ql5$1c6h$1 digitaldaemon.com...
 I'm not taking anything as flame (that's just how I react occasionally.
;)
 I didn't mean my post as reactionary or flame either;  sorry if you took
it
 that way.

 Oh well I can live with semicolons.  Not a big deal.  It's better than
 having to surround every statement with parenthesis or braces.

 I just wish the IDE/Editor performed more of these functions.  The
 text-based nature of programming languages is getting me down lately.  A
 smart IDE can detect errors as you type, and could auto-indent, as well
as,
 say, draw barely-visible boxes around each statement or whatever.

 You could program in a sort of boxes, plugs, and sockets view; a kind of
 data flow graph.  Maybe toggle back and forth between that and text view.
 Or to a class hierarchy view.  The raw text view is so restrictive and
 antiquated in comparison.  One could make a programming language that
didn't
 use text at all if you tried.

 What's really important in a language (to me) is the conceptual
 relationships between its elements. What gets what to do what with what.

 Sean

 "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 news:3D065180.651B3109 deming-os.org...
 "Sean L. Palmer" wrote:

 Someone *could* write this:

 int a;b,

 int c = b+;
 a = a ++ b;

 Now what the hell does *that* do?  And how is that any more or less
likely
 than forgetting a semicolon?
Sounds like my previous post sounded like a flame. I'm sorry - I
certainly
 didn't mean it that way.

 What I was trying to illustrate was that a simple typo resulted in
legal -
 but
 unintended code.  I thought that the example was useful because at first
I
 was
 going to agree with you.  However, when the counterexample crossed my
mind, I
 changed my opinion.  For that reason, I thought that it was a good way
to
 illustrate my (changed) opinion.

 My argument is just a variant of Walter's old argument: "If any binary
stream
 of data is a valid code, then there are no syntax errors.  Syntax errors
give
 you a simple sanity check to catch (some of the) invalid code."  I think
that
 semicolons do remarkably well in that role.

 Again, sorry for any flamish posts...
Jun 12 2002
parent reply "Andrew" <crxace13 comcast.net> writes:
I think Epsilon could be a good place to start! Were I capable, I would
just streamline the program for D only. Of course you could just add
support for D given the many different languages in which the mass probably
programs. It is already available for WinDoze, Linux, FreeBSD, and OS/2
platforms (source code provided).

Andrew

"anderson" <anderson firestar.com.au> wrote in message
news:ae7jdn$jpl$1 digitaldaemon.com...
| PCgrasp draws boxes and things around code as you type. I always turn it
of
| because It annoys me. Any how PCgrasp is lacking in many other areas.
|
| I am considering writting a D focused IDE if I get some time. I would
like
| to make it UML focused, like rational rose (or visual modeler) but
simpler
| and with all the programming IDE stuff as well. I'd make it strongly
reliant
| on plugs so that I won't need to write everything and so users could
| customise it.
|
| I would probably have to do it in C++ not D because it supports extenable
| controls that are in MFC, which win32 doesn't (but I may be wrong). Or is
| there another way?
|
|
|
| "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
| news:ae6ql5$1c6h$1 digitaldaemon.com...
| > I'm not taking anything as flame (that's just how I react occasionally.
| ;)
| > I didn't mean my post as reactionary or flame either;  sorry if you
took
| it
| > that way.
| >
| > Oh well I can live with semicolons.  Not a big deal.  It's better than
| > having to surround every statement with parenthesis or braces.
| >
| > I just wish the IDE/Editor performed more of these functions.  The
| > text-based nature of programming languages is getting me down lately.
A
| > smart IDE can detect errors as you type, and could auto-indent, as well
| as,
| > say, draw barely-visible boxes around each statement or whatever.
| >
| > You could program in a sort of boxes, plugs, and sockets view; a kind
of
| > data flow graph.  Maybe toggle back and forth between that and text
view.
| > Or to a class hierarchy view.  The raw text view is so restrictive and
| > antiquated in comparison.  One could make a programming language that
| didn't
| > use text at all if you tried.
| >
| > What's really important in a language (to me) is the conceptual
| > relationships between its elements. What gets what to do what with
what.
| >
| > Sean
| >
| > "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
| > news:3D065180.651B3109 deming-os.org...
| > > "Sean L. Palmer" wrote:
| > >
| > > > Someone *could* write this:
| > > >
| > > > int a;b,
| > > >
| > > > int c = b+;
| > > > a = a ++ b;
| > > >
| > > > Now what the hell does *that* do?  And how is that any more or less
| > likely
| > > > than forgetting a semicolon?
| > >
| > > Sounds like my previous post sounded like a flame.  I'm sorry - I
| > certainly
| > > didn't mean it that way.
| > >
| > > What I was trying to illustrate was that a simple typo resulted in
| legal -
| > but
| > > unintended code.  I thought that the example was useful because at
first
| I
| > was
| > > going to agree with you.  However, when the counterexample crossed my
| > mind, I
| > > changed my opinion.  For that reason, I thought that it was a good
way
| to
| > > illustrate my (changed) opinion.
| > >
| > > My argument is just a variant of Walter's old argument: "If any
binary
| > stream
| > > of data is a valid code, then there are no syntax errors.  Syntax
errors
| > give
| > > you a simple sanity check to catch (some of the) invalid code."  I
think
| > that
| > > semicolons do remarkably well in that role.
| > >
| > > Again, sorry for any flamish posts...
| >
| >
| >
|
|
Jun 12 2002
parent "anderson" <anderson firestar.com.au> writes:
Apone looking at Epsilon It seems little more then a text editor with text
highlighting and lots of nifty functions. Don't get me wrong, it does have
some great features. It does seem to be lacking in things like help as you
write (things like showing the parameters of functions you call as you
write). It doesn't seem to have project managment (being able to show class
structure and more then one source at once). And as far as I can see it
doesn't have much graphical support for things such as UML.

Parhaps these issues may be addressable? Parhaps the code could be extended
to include these features. Parhaps some overlay program could be written and
use Epsilon as the code editor, using OLE or something.

Anyway these are just my thoughts.

"Andrew" <crxace13 comcast.net> wrote in message
news:ae7k1d$qir$1 digitaldaemon.com...
 I think Epsilon could be a good place to start! Were I capable, I would
 just streamline the program for D only. Of course you could just add
 support for D given the many different languages in which the mass
probably
 programs. It is already available for WinDoze, Linux, FreeBSD, and OS/2
 platforms (source code provided).

 Andrew

 "anderson" <anderson firestar.com.au> wrote in message
 news:ae7jdn$jpl$1 digitaldaemon.com...
 | PCgrasp draws boxes and things around code as you type. I always turn it
 of
 | because It annoys me. Any how PCgrasp is lacking in many other areas.
 |
 | I am considering writting a D focused IDE if I get some time. I would
 like
 | to make it UML focused, like rational rose (or visual modeler) but
 simpler
 | and with all the programming IDE stuff as well. I'd make it strongly
 reliant
 | on plugs so that I won't need to write everything and so users could
 | customise it.
 |
 | I would probably have to do it in C++ not D because it supports
extenable
 | controls that are in MFC, which win32 doesn't (but I may be wrong). Or
is
 | there another way?
 |
 |
 |
 | "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 | news:ae6ql5$1c6h$1 digitaldaemon.com...
 | > I'm not taking anything as flame (that's just how I react
occasionally.
 | ;)
 | > I didn't mean my post as reactionary or flame either;  sorry if you
 took
 | it
 | > that way.
 | >
 | > Oh well I can live with semicolons.  Not a big deal.  It's better than
 | > having to surround every statement with parenthesis or braces.
 | >
 | > I just wish the IDE/Editor performed more of these functions.  The
 | > text-based nature of programming languages is getting me down lately.
 A
 | > smart IDE can detect errors as you type, and could auto-indent, as
well
 | as,
 | > say, draw barely-visible boxes around each statement or whatever.
 | >
 | > You could program in a sort of boxes, plugs, and sockets view; a kind
 of
 | > data flow graph.  Maybe toggle back and forth between that and text
 view.
 | > Or to a class hierarchy view.  The raw text view is so restrictive and
 | > antiquated in comparison.  One could make a programming language that
 | didn't
 | > use text at all if you tried.
 | >
 | > What's really important in a language (to me) is the conceptual
 | > relationships between its elements. What gets what to do what with
 what.
 | >
 | > Sean
 | >
 | > "Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
 | > news:3D065180.651B3109 deming-os.org...
 | > > "Sean L. Palmer" wrote:
 | > >
 | > > > Someone *could* write this:
 | > > >
 | > > > int a;b,
 | > > >
 | > > > int c = b+;
 | > > > a = a ++ b;
 | > > >
 | > > > Now what the hell does *that* do?  And how is that any more or
less
 | > likely
 | > > > than forgetting a semicolon?
 | > >
 | > > Sounds like my previous post sounded like a flame.  I'm sorry - I
 | > certainly
 | > > didn't mean it that way.
 | > >
 | > > What I was trying to illustrate was that a simple typo resulted in
 | legal -
 | > but
 | > > unintended code.  I thought that the example was useful because at
 first
 | I
 | > was
 | > > going to agree with you.  However, when the counterexample crossed
my
 | > mind, I
 | > > changed my opinion.  For that reason, I thought that it was a good
 way
 | to
 | > > illustrate my (changed) opinion.
 | > >
 | > > My argument is just a variant of Walter's old argument: "If any
 binary
 | > stream
 | > > of data is a valid code, then there are no syntax errors.  Syntax
 errors
 | > give
 | > > you a simple sanity check to catch (some of the) invalid code."  I
 think
 | > that
 | > > semicolons do remarkably well in that role.
 | > >
 | > > Again, sorry for any flamish posts...
 | >
 | >
 | >
 |
 |
Jun 12 2002
prev sibling parent reply "OddesE" <OddesE_XYZ hotmail.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ae6ql5$1c6h$1 digitaldaemon.com...
 I'm not taking anything as flame (that's just how I react occasionally.
;)
 I didn't mean my post as reactionary or flame either;  sorry if you took
it
 that way.

 Oh well I can live with semicolons.  Not a big deal.  It's better than
 having to surround every statement with parenthesis or braces.

 I just wish the IDE/Editor performed more of these functions.  The
 text-based nature of programming languages is getting me down lately.  A
 smart IDE can detect errors as you type, and could auto-indent, as well
as,
 say, draw barely-visible boxes around each statement or whatever.

 You could program in a sort of boxes, plugs, and sockets view; a kind of
 data flow graph.  Maybe toggle back and forth between that and text view.
 Or to a class hierarchy view.  The raw text view is so restrictive and
 antiquated in comparison.  One could make a programming language that
didn't
 use text at all if you tried.

 What's really important in a language (to me) is the conceptual
 relationships between its elements. What gets what to do what with what.

 Sean
Sean, check out this article called SCID - Source Code In Database: http://mindprod.com/scid.html I found it to be a very iluminating article, with some great ideas! It talks about a lot of the things you mention in your post. Incidentally, we have already been talking on this group on something that comes close to this, DML, a format to store D source code in XML. The idea is that you store only the pure code and leave petty details like indentation to be handled by the editor and an XSLT stylesheet with some preferences. DML never came further than pipe-dream status though... :( -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 26 2002
parent "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I've read it previously.  It's like the guy read my mind!!

Sean

"OddesE" <OddesE_XYZ hotmail.com> wrote in message
news:afd5jl$29dg$1 digitaldaemon.com...
 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:ae6ql5$1c6h$1 digitaldaemon.com...
 I'm not taking anything as flame (that's just how I react occasionally.
;)
 I didn't mean my post as reactionary or flame either;  sorry if you took
it
 that way.

 Oh well I can live with semicolons.  Not a big deal.  It's better than
 having to surround every statement with parenthesis or braces.

 I just wish the IDE/Editor performed more of these functions.  The
 text-based nature of programming languages is getting me down lately.  A
 smart IDE can detect errors as you type, and could auto-indent, as well
as,
 say, draw barely-visible boxes around each statement or whatever.

 You could program in a sort of boxes, plugs, and sockets view; a kind of
 data flow graph.  Maybe toggle back and forth between that and text
view.
 Or to a class hierarchy view.  The raw text view is so restrictive and
 antiquated in comparison.  One could make a programming language that
didn't
 use text at all if you tried.

 What's really important in a language (to me) is the conceptual
 relationships between its elements. What gets what to do what with what.

 Sean
Sean, check out this article called SCID - Source Code In Database: http://mindprod.com/scid.html I found it to be a very iluminating article, with some great ideas! It talks about a lot of the things you mention in your post. Incidentally, we have already been talking on this group on something that comes close to this, DML, a format to store D source code in XML. The idea is that you store only the pure code and leave petty details like indentation to be handled by the editor and an XSLT stylesheet with some preferences. DML never came further than pipe-dream status though... :( -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 27 2002
prev sibling parent reply "anderson" <anderson firestar.com.au> writes:
Racking my brain to think of a simple case:

How about this case,

for(int n; n<Max && !isFound(n); n++);

if (n != Max) //found at n-1
{
...
}

but without semicolon

for(int n; n<Max && !isFound(n); n++)

if (n != Max) //found at n-1
{
...
}

Beep - ERROR

This would mean manditory bracks are needed for the complier to make sense
of it.


"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:advgr5$2seb$1 digitaldaemon.com...
 I would like to humbly ask that semicolons not be mandatory statement
 separators in D, but that they be equivalent to newline, and that newline
is
 a potential statement separator, semicolon is a definite one, and
semicolon
 + newline is treated as only one separation.

 if (ihadacoollanguage)
 {
   int a = b + c
   int k = b + c +
              d + e   // these don't count because they don't parse in the
 same places comma and semicolon do.
   int j = b + c
             + d + e  // it actually has to be looking for a comma or
 semicolon for a newline to work instead
   // or it at least needs the remaining fragment to not to compile without
 treating the eoline as a terminator
   char[]
      thisstillworkshowever(char[]a,  // comma is ok, it's just not
necessary
                                       char[]b // comma optional because
 there's a newline instead
                                       char[]c;  // semi optional where
comma
 is accepted?
                                       char[]d);
 }

 I mean, I would like my compiler to not pick nits about semicolons.  If I
 forget one, so friggin what it usually doesn't matter... the compiler has
 figured it out that it indeed was a missing semicolon big friggin deal,
just
 deal with it and move on.  It should be a warning at best.  In order for
the
 compiler to figure out that a semicolon is missing, it is known that a
 semicolon must be inserted to fix the problem, but since that's a legal
fix
 it should just do it.

 It's like real english, sometimes you Dot all you're P"s and q's and
 someTimes you don't, and yes the code would be nicer if you did all your
 grammar homework or weren't lazy it's not crucial to get the point across.
 Allowing slop in syntax allows one to do quick "phrasing" while blocking
out
 the code and clean up the subtle issues later. (if this ever becomes an
 issue because maybe the program works perfectly as written)  Sometimes you
 just wanna test something quickly and do some cut'n'paste and the last
thing
 you want to see is some stupid "you forgot a semicolon" problems.

 Yes I realize it would maybe create a few bugs;  about as many as for(;;);
 has.  Number of bugs created by a construct is proportional to the number
of
 times that construct is used by someone.  Useful constructs will
inherently
 generate more bugs up to a point.

 Sean
Jun 14 2002
next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
"anderson" <anderson firestar.com.au> wrote in message
news:aee9k9$1baf$1 digitaldaemon.com...

 How about this case,

 for(int n; n<Max && !isFound(n); n++);
The compiler won't allow you to do this, anyhow. You need to use { } for both cases. So, the funny thing is, the first case would give an error, while the second won't =)
Jun 14 2002
parent "anderson" <anderson firestar.com.au> writes:
There I go again, putting my foot in my mouth.


"Pavel Minayev" <evilone omen.ru> wrote in message
news:aeeleo$1m8q$1 digitaldaemon.com...
 "anderson" <anderson firestar.com.au> wrote in message
 news:aee9k9$1baf$1 digitaldaemon.com...

 How about this case,

 for(int n; n<Max && !isFound(n); n++);
The compiler won't allow you to do this, anyhow. You need to use { } for both cases. So, the funny thing is, the first case would give an error, while the second won't =)
Jun 15 2002
prev sibling parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I usually put braces there in any case because they're more visible than a
semicolon.

Sean

"anderson" <anderson firestar.com.au> wrote in message
news:aee9k9$1baf$1 digitaldaemon.com...
 Racking my brain to think of a simple case:

 How about this case,

 for(int n; n<Max && !isFound(n); n++);

 if (n != Max) //found at n-1
 {
 ...
 }

 but without semicolon

 for(int n; n<Max && !isFound(n); n++)

 if (n != Max) //found at n-1
 {
 ...
 }

 Beep - ERROR

 This would mean manditory bracks are needed for the complier to make sense
 of it.
Jun 15 2002
next sibling parent reply "OddesE" <OddesE_XYZ hotmail.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:aef61u$2j1f$1 digitaldaemon.com...
 I usually put braces there in any case because they're more visible than a
 semicolon.

 Sean
Yes, or place the semicolon on a line by itself: for(int n; n<Max && !isFound(n); n++) ; But I think this is best: for(int n; n<Max && !isFound(n); n++) { } for(int n; n<Max && !isFound(n); n++); This sucks, it is too easy to miss the semicolon here! -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 26 2002
parent "Matthew Wilson" <matthew thedjournal.com> writes:
I actually prefer

for(blah; blah; blah)
{}

which is distinguished from all other fors (ie. any that are not
specifically intended to contain no statements) denoted as

for(blah; blah; blah)
{
    ...
}

by the use of {}. This {} denotes a conscious decision to "contain nothing"

Either way, the use of braces is far more visible than a semicolon


"OddesE" <OddesE_XYZ hotmail.com> wrote in message
news:afd5sf$29ka$1 digitaldaemon.com...
 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:aef61u$2j1f$1 digitaldaemon.com...
 I usually put braces there in any case because they're more visible than
a
 semicolon.

 Sean
Yes, or place the semicolon on a line by itself: for(int n; n<Max && !isFound(n); n++) ; But I think this is best: for(int n; n<Max && !isFound(n); n++) { } for(int n; n<Max && !isFound(n); n++); This sucks, it is too easy to miss the semicolon here! -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 26 2002
prev sibling parent reply Karl Bochert <kbochert ix.netcom.com> writes:
On Sat, 15 Jun 2002 03:58:04 -0700, "Sean L. Palmer" <seanpalmer earthlink.net>
wrote:
 I usually put braces there in any case because they're more visible than a
 semicolon.
 
Semicolons (and other punctuation) is much easier to see with the appropriate font. I use a font that enhances these characters and it does change what I consider readable!
Jun 27 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
I agree that a different color or font will help (somewhat!) but the main
problem is that the brain selectively filters out the ubiquitous semicolon
(because it's *everywhere*) so you plain don't perceive it even though your
eyes can easily see it.  The opposite is even more true, the lack of a
semicolon just doesn't "jump out" at you.

Automatic IDE indentation would solve most of this.  But IDE's are not part
of a core language spec.  ;(

Sean

"Karl Bochert" <kbochert ix.netcom.com> wrote in message
news:1103_1025228880 bose...
 On Sat, 15 Jun 2002 03:58:04 -0700, "Sean L. Palmer"
<seanpalmer earthlink.net> wrote:
 I usually put braces there in any case because they're more visible than
a
 semicolon.
Semicolons (and other punctuation) is much easier to see with the
appropriate font. I use
 a font that enhances these characters and it does change what I consider
readable!
Jun 27 2002
parent "anderson" <anderson firestar.com.au> writes:
I tend to agree with you. I only didn't like taking out those repetitive
ugly semicolon because it caused problems in C/C++, but D seems to have
fixed most of those things. On the other hand there are cases where you need
to use full stops, otherwise things get confusing.

"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:afgp92$hkq$1 digitaldaemon.com...
 I agree that a different color or font will help (somewhat!) but the main
 problem is that the brain selectively filters out the ubiquitous semicolon
 (because it's *everywhere*) so you plain don't perceive it even though
your
 eyes can easily see it.  The opposite is even more true, the lack of a
 semicolon just doesn't "jump out" at you.

 Automatic IDE indentation would solve most of this.  But IDE's are not
part
 of a core language spec.  ;(

 Sean

 "Karl Bochert" <kbochert ix.netcom.com> wrote in message
 news:1103_1025228880 bose...
 On Sat, 15 Jun 2002 03:58:04 -0700, "Sean L. Palmer"
<seanpalmer earthlink.net> wrote:
 I usually put braces there in any case because they're more visible
than
 a
 semicolon.
Semicolons (and other punctuation) is much easier to see with the
appropriate font. I use
 a font that enhances these characters and it does change what I consider
readable!
Jun 27 2002