To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 8467
8466  |  8468
Subject: 
Re: Backwards Compatibility (Was Calling all Meta-commands)
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 16 Mar 2003 18:46:25 GMT
Viewed: 
2547 times
  
In lugnet.cad.dev, Dan Boger writes:
On Sun, Mar 16, 2003 at 05:54:10PM +0000, Kevin Clague wrote:
I think we cannot ignore the backwards compatibility issue though.

right.

What we want is an explicit way to differentiate comments from
meta-commands.  I think defining an explicit mechanism for comments is
completely backward compatible, because if you do not recognize the first
token in a type 0 record, it is a comment.

By using (META) or {META}, you've caused more hassles than you've solved.
Now we programmers have to change our programs to parse type 0 records in
two ways:  The way we have today ("0 token"), *and* the new way ("0 (META)
token").

but you just said you're doing that anyway - "if you do not recognize
the first token in a line type 0 record, it is a comment".  Is adding
'{META}' to the list of recognizable tokens an issue?  Also, you don't
have to add it - if you don't, the line is ignored, just like any other
comment.  Perfect!

The exact same argment can be used in favor of dillineated comments. ;-)


It makes a lot more sense to me to provide an explicit way to
differentiate comments using some keyword (COMMENT, //, #, !, etc.) You
document the magic comment token so that no one can ever define that as a
meta-command, and you greatly reduce the probability that someone's first
token in a comment line is mistaken as a meta-command.

wouldn't that break backwards compatibility with ldraw.exe?  Or does it
recognize any of those as a valid, but ignorable line?

Nope.  Any program that does not recognize // (picking one as an example)
simply ignores it.  Just like (META).


It is very common in programming language to differentiate comments from
language significant grammar using comment start tokens than it is to
identify the things the computer is supposed to pay attention to (i.e. (META)).

right, but it's not unhead of to use special comments as "hints" to the
program - like "#define", etc.

I don't want to get sidetracked here, but #define is not a special comment.

Our current case with type 0 records is exactly the case you outlined above.
Meta-commands are special comments used as "hints".

The only real problem that arises is when the user starts a type 0 record
with a token that happens to be interpreted as a meta-command.  They might
get an error message that completely confuses them.  Comments can cause
errors ?!?!

If we treat // as a meta-command that means comment, and people use them,
then we eliminate the issue without changing a single line of code.


Using (META) causes more work for us programmers and really doesn't solve
much of anything.

That might be true - I'm not one of the programmers who has to implement
these, so I don't get a say here.  I do think it solves the problem of
accidental meta-commands in unintentional comments.

As does having people switch to // to specifically delineate comments.


:)

We can even continue with the status quo, but there will always be confusion
about what is a comment and what is a meta-command.  If we go for // as a
comment indicator, we will always have two forms of comments: implicit
comments, and explicit comments.  If we got for (META) as a meta-command
indicator, we will always have two forms of meta-commands:  implicit and
explicit.  We always run the risk of these two problems:

1) Someone creates a new meta-command that falsly triggers on someones old
comments. (avoidable by making all new meta-commands start with (META))
2) Someone creates a comment that starts with a token that someone had
already used as a meta-command. (avoidable by making new comments using //).

Thus the nature of backwards compatility.

Maybe we need to do both?

I'd personally prefer something like ! instead of (META) or {META}, but that
is because I'm used to the concept in unix.

Kevin



Message has 1 Reply:
  Re: Backwards Compatibility (Was Calling all Meta-commands)
 
(...) As I tried to indicate in one of my posts much earlier in this thread, I realized after my original post that the presense of the {} would negate the need for a {META} tag. It would probably work just as well with (). The whole reason I (...) (22 years ago, 16-Mar-03, to lugnet.cad.dev)

Message is in Reply To:
  Re: Backwards Compatibility (Was Calling all Meta-commands)
 
(...) right. (...) but you just said you're doing that anyway - "if you do not recognize the first token in a line type 0 record, it is a comment". Is adding '{META}' to the list of recognizable tokens an issue? Also, you don't have to add it - if (...) (22 years ago, 16-Mar-03, to lugnet.cad.dev)

154 Messages in This Thread:
(Inline display suppressed due to large size. Click Dots below to view.)
Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR