05 Aug, 2010, Mudder wrote in the 1st comment:
Votes: 0
#DEFINE    LOWER©               ( ( c ) >= 'A' && © <= 'Z' ? ( c ) + 'a' - 'A' : © )


This just checks whether c is a letter of the alphabet and if so, it does © + 'a' - 'A' … Since the name is lower I assume it converts to lowercase, but how?
05 Aug, 2010, Kaz wrote in the 2nd comment:
Votes: 0
Assuming that A..Z and a..z are contiguous in the character set (not guaranteed, but for our purposes we can consider it to be so for all practical platforms), 'a' - 'A' will give you a transformation necessary to convert to lower case.

For example, if 'a' is 98, and 'A' is 65, then adding (98-65 = 33) to a character will make it lower case.

Test case: 'B' is 66, 'b' is 99. 'B' + 33 == 'b'.
05 Aug, 2010, David Haley wrote in the 3rd comment:
Votes: 0
You're better off using the standard function tolower; it will get the nasty details right in case the characters aren't contiguous etc. as Kaz pointed out, although as he said for all practical intents and purposes they will be.
05 Aug, 2010, Runter wrote in the 4th comment:
Votes: 0
Its curious as to why the macro even exists. I imagine it could possibly predate tolower.
05 Aug, 2010, Mudder wrote in the 5th comment:
Votes: 0
Apparently it's standard ROM. I'm moving it to std::string and came across this in the one_argument function, I wanted to be certain to convert things properly. :)

Thanks guys.

EDIT: Wouldn't this be less overhead than calling another function tolower() ? All this talk of ROM cutting corners…
05 Aug, 2010, Runter wrote in the 6th comment:
Votes: 0
You're talking about a trivial amount of overhead.

By this rationale replacing any given function with macro expansion would be desirable. Macros have increasingly been frowned upon for the last 20 or so years now.
05 Aug, 2010, David Haley wrote in the 7th comment:
Votes: 0
The compiler will sometimes online tiny functions anyhow, especially if they're stdlib. Regardless as Runter said the overhead is tiny.
06 Aug, 2010, JohnnyStarr wrote in the 8th comment:
Votes: 0
David Haley said:
The compiler will sometimes online tiny functions anyhow, especially if they're stdlib. Regardless as Runter said the overhead is tiny.


Did you mean inline? Not trying to knit-pick, but I haven't heard of that term as far as compilers are concerned. :smirk:
06 Aug, 2010, David Haley wrote in the 9th comment:
Votes: 0
Oops, yes, my phone was overzealous in its autocorrect. I did mean inline not online.
06 Aug, 2010, Twisol wrote in the 10th comment:
Votes: 0
JohnnyStarr said:
Did you mean inline? Not trying to knit-pick, but I haven't heard of that term as far as compilers are concerned. :smirk:

Did you mean nitpick? Not trying to nitpick, but I couldn't resist. :biggrin:

*retreats into obscurity again*
06 Aug, 2010, Kjwah wrote in the 11th comment:
Votes: 0
Twisol said:
JohnnyStarr said:
Did you mean inline? Not trying to knit-pick, but I haven't heard of that term as far as compilers are concerned. :smirk:

Did you mean nitpick? Not trying to nitpick, but I couldn't resist. :biggrin:

*retreats into obscurity again*


At the risk of being off topic(wait, we already are), I just had to say lol
06 Aug, 2010, Kaz wrote in the 12th comment:
Votes: 0
Quote
Not trying to knit-pick


Nit-pick. Ooh, meta.
06 Aug, 2010, Runter wrote in the 13th comment:
Votes: 0
Which muds did you play in the 90s, kaz? There was a kaz that fits your personality on a small one I frequented.
06 Aug, 2010, Runter wrote in the 14th comment:
Votes: 0
Which muds did you play in the 90s, kaz? There was a kaz that fits your personality on a small one I frequented.
06 Aug, 2010, Kaz wrote in the 15th comment:
Votes: 0
Runter said:
Which muds did you play in the 90s, kaz? There was a kaz that fits your personality on a small one I frequented.


Probably not me. I played with my full nick back then, Kastagaar. I was mainly on Land of Legends (not the one whose implementor is on these forums, the old one that closed), and occasionally A Moment in Tyme. I also implemented for Continents Mud (which, I'm happy to say, is still around. If anyone plays it, say hello to the crew from me!)

What mud did you have in mind?
06 Aug, 2010, Runter wrote in the 16th comment:
Votes: 0
A mud called Exile.
06 Aug, 2010, Kaz wrote in the 17th comment:
Votes: 0
Runter said:
A mud called Exile.


Never heard of it. Sorry!
0.0/17