flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Case of the names

Author
Thread Post new topic Reply to topic
booter



Joined: 08 Dec 2006
Posts: 67
booter
I would really like to have an option to forbid using same names with different "casing". I mean, using both Name1 and NAME1 in the same program should be disallowed. It's a bad style anyway.
Post 29 Dec 2009, 01:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
So you want to make names case-insensitive?

You could make your own version of fasm and post the changes here. You never know, Tomasz might decide it is a good idea and include it. Wink
Post 29 Dec 2009, 02:03
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
Its quite useful.
Say we have an equate or macro in uppercase as NAME1
and then we could have a variable or procedure as Name1 also.
It really comes down to coding style...
Post 29 Dec 2009, 03:48
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
And actually it can also be used in labels. For instance, if you would like to emulate objects you could name the class "Matrix" (where the VMT, class variables and other data is stored) and then have an instance variable called "matrix" (this practice is not uncommon).

I think I have some code that would be broke by such change but well, I get no revenue from my Assembly code and nothing is used in production so it wouldn't be a very big problem for me this backward incompatibility...
Post 29 Dec 2009, 04:45
View user's profile Send private message Reply with quote
booter



Joined: 08 Dec 2006
Posts: 67
booter
LocoDelAssembly wrote:
... you could name the class "Matrix" (where the VMT, class variables and other data is stored) and then have an instance variable called "matrix" (this practice is not uncommon).
That's exactly what I want to be prohibited (optionally).
It may be useful for developer, but it makes reading the program text a nightmare.
BTW, I also dislike labels like that "I1lO0OrnmVVW" Smile
Post 08 Jan 2010, 00:36
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:
That's exactly what I want to be prohibited (optionally).

I like this idea, it won't break compatibility. The only problem would be to define how this feature would be enabled. I think that a command line argument won't be a problem as it probably won't break SSSO principle and forgetting to use the option wouldn't make the source uncompilable.
Post 08 Jan 2010, 00:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
It would break SSSO:
Code:
a=1
A=2
db a
    


You would get different output on same source depending on command line params.
Post 08 Jan 2010, 12:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Yep, and very simple example, I'm getting reeeeally old Sad
Post 08 Jan 2010, 16:10
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
@booter - I totally agree about the bad style.
But style is for the programmer to decide, FASM is just easel letting you paint whatever you want on it.

If you decide not to use Name1 and NAME1 then FASM won't need to enforce your decision. Enforcing code style is a HLL concept not really suitable for ASM (maybe low level programmers are too stubborn and set in their ways to conform to a widely agreed upon syntax standard),
Post 08 Jan 2010, 19:50
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:  


< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.