flat assembler
Message board for the users of flat assembler.

Index > Main > Add block-comments into Fasm?

Goto page Previous  1, 2, 3

Add block-comments into Fasm?
Yes, absolutely
56%
 56%  [ 37 ]
I use this sparely (in other languages)
12%
 12%  [ 8 ]
No need
19%
 19%  [ 13 ]
Don't do this, it would anticipate with Fasm's concepts
9%
 9%  [ 6 ]
Donno
3%
 3%  [ 2 ]
Total Votes : 66

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
I think IDE could perform block commenting for us and it could do it this way: insert two ";"s into every line which is part of a selected block for commenting.. On uncommenting delete two ";"s from every line that starts with two ";"s. Using two semicolons will differ commented code from comments, so uncommenting will leave comments there.
Post 18 Dec 2004, 11:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius
I think we should have block comments, but they should not at all interfere with current features, or make the language less intuitive or easy to use. If we used, for example, this as ablock comment starter:

;_

then any existing comments that use that would cause problems. If, however, we use a new symbol or group of symbols, it would be fine. If we DID use ";_" then at least make it easy to change any existing comments so they work - maybe by making it so if a "_" is at the end of the line it will end the comment.
Post 18 Mar 2005, 16:44
View user's profile Send private message AIM Address Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
For block comments i like the sintax used in Rosasm it uses ';;' at the begining of the line to signal comment start-end, this has the advantage
that is very fast to skip comments and easy to implement.
Post 18 Mar 2005, 17:56
View user's profile Send private message Visit poster's website Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
Well, you could use this:
Code:
bcomment fix macro CommentBlock {
ecomment fix }
bcomment
Blah Blah Blah
This stuff is all blahness
Commentation
ecomment
    

The only drawback is that you cannot have } in the comment.

_________________
This calls for... Ultra CRUNCHY Man!
Ta da!! *crunch*
Post 08 Apr 2005, 01:24
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 604
Location: Germany
MCD
UCM wrote:

Code:
bcomment fix macro CommentBlock {
ecomment fix }
bcomment
Blah Blah Blah
This stuff is all blahness
Commentation
ecomment
    


Seems to be a good approach. I'm just wondering it didn't fell into my mind earlier Rolling Eyes
Post 08 Apr 2005, 06:20
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
UCM wrote:
Well, you could use this:
Code:
bcomment fix macro CommentBlock {
ecomment fix }
bcomment
Blah Blah Blah
This stuff is all blahness
Commentation
ecomment
    

The only drawback is that you cannot have } in the comment.

_________________
This calls for... Ultra CRUNCHY Man!
Ta da!! *crunch*


can you have reserved words like 'reverse' on the comment?
Post 08 Apr 2005, 17:12
View user's profile Send private message Visit poster's website Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
Octavio, it doesn't matter, because the block is never (or at least shouldn't be) processed, except at definition. I've tested this, and it's fine. The only character that I can think of that you can't have is }.
Post 08 Apr 2005, 21:27
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
I have a few "comments"
-The only reason for block commenting in ASM is to comment out a procedure while you test changes to it.
-Implementing block commenting so you can add more documentation is foolish, just use a readme file.
-No one is going to use a macro for block commenting that's just silly IMO
-IDE's are supposed to make life easier so I suggest FASMW add a scratchpad/clipboard feature so you can highlight a chunk of code and hit a Hot Key and be able to view it while your writing 'say' a more optimized version. This would be very helpful while imrpoving algorithms as having the original to look at while improving it without having to worry about commenting one line out and another line in.
Post 08 Apr 2005, 23:37
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
UCM wrote:
Octavio, it doesn't matter, because the block is never (or at least shouldn't be) processed, except at definition. I've tested this, and it's fine. The only character that I can think of that you can't have is }.

i have done a few tests and it seems that 'fix' is processed and also symbols defined with it, so it works fine if you use with care.
Post 08 Apr 2005, 23:40
View user's profile Send private message Visit poster's website Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
r22:
This isn't macro... its 'fix' lol hehe

Octavio:
Good point, 'fix' is higher priority than 'macro', so 'fix' will be preprocessed. I haven't tested all of the reserved words though.

EDIT: How did you get symbols defined with 'fix' in the macro? I tried and it didn't work.

_________________
This calls for... Ultra CRUNCHY Man!
Ta da!! *crunch*
Post 08 Apr 2005, 23:45
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
UCM wrote:
r22:
EDIT: How did you get symbols defined with 'fix' in the macro? I tried and it didn't work.

'ecoment' is processed isn't it?
usually this is not a problem ,the symbol is expanded and ignored unless you do something like this:

fix will }
bcoment
this will result in a error
ecoment
Post 09 Apr 2005, 14:02
View user's profile Send private message Visit poster's website Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
Octavio, I don't understand what you mean.

I just thought of a way to illustrate that } is not allowed inside comment for new users:
Code:
comment fix macro CommentBlock
comment {
Blah Blah Blah
Funnyish commenting
}
    


EDIT: I understand now what you mean Octavio, that symbols defined earlier before comment block will be processed. So you can't, for example, put 'endg' when using Fresh macro library on its own line inside comment.

Another EDIT: I just noticed that the above syntax was mentioned earlier. Hmm, maybe I wasn't reading properly... Confused

_________________
This calls for... Ultra CRUNCHY Man!
Ta da!! *crunch*
Post 09 Apr 2005, 17:01
View user's profile Send private message Reply with quote
PopeInnocent



Joined: 01 Jan 2004
Posts: 18
Location: USA
PopeInnocent
I am in favor of having a native block-commenting feature in fasm, but I am more in favor of waiting as long as it takes for Privalov to decide if and how to implement it. Done poorly, block comments could screw up a big chunk of the fasm code out there. Done right, block comments will make my life a whole lot easier when I need to rip out hundreds of lines that I was too lazy to properly test. Smile

I read several assertions that there is no place in source code for detailed documentation. I disagree for two reasons.

One, documentation is more likely to stay in sync with code if it is immediately next to the code. I have external documentation ("readme" files) in most of my big projects, and invariably those files are obsolete before the bytes hit the hard drive. The source code itself may be the ultimate documentation, but if more of you bothered to document your code, you might discover that more people use and appreciate it. If it were easier to write freeform comments (therefore, block comments), more of you might, um, comment.

Two, how often have you written a dozen lines of convoluted, utterly incomprehisble code because it was the only efficient way to get something done? While it isn't common practice to apologize to your readers, the least you can do is take a few lines explaining what your code does.
Post 13 Apr 2005, 01:28
View user's profile Send private message Reply with quote
Pirata Derek



Joined: 31 Oct 2008
Posts: 259
Location: Italy
Pirata Derek
Why doesn't block comment starts with double ; and ends with the same?

EXAMPLE:

;; hola amigo
como te pasa? ;;
Post 16 Jul 2009, 09:47
View user's profile Send private message Send e-mail Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
Quote:
Why doesn't block comment starts with double ; and ends with the same?

Because it would break backwards compatibility terribly.
Post 16 Jul 2009, 10:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
r22 wrote:
I have a few "comments"
-The only reason for block commenting in ASM is to comment out a procedure while you test changes to it.
-Implementing block commenting so you can add more documentation is foolish, just use a readme file.
-No one is going to use a macro for block commenting that's just silly IMO
-IDE's are supposed to make life easier so I suggest FASMW add a scratchpad/clipboard feature so you can highlight a chunk of code and hit a Hot Key and be able to view it while your writing 'say' a more optimized version. This would be very helpful while imrpoving algorithms as having the original to look at while improving it without having to worry about commenting one line out and another line in.

Reading my own comments from 4 years ago is kind of eerie. I started reading it before noticing the submitted by name and no recollection of writing it.

Block commenting will stand as the only, albeit minor, flaw in FASM v1 from the beginning.
Post 16 Jul 2009, 12:37
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.