|
Multilanguage Truth
Last post 01-21-2008 5:30 PM by elgate. 29 replies.
-
01-16-2008 11:08 AM
|
|
-
yoz-y


- Joined on 05-06-2006
- Posts 3
|
#define TRUE (1 == 1) <= ow my eyes
#define boolean int <= what ?
now in my college they took a different approach :
(found in a C source file we had to work on on C classes) typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1} Booleen; Not only they managed to handle the personal preferences of everybody. They also happened to provide both French and English wordings. I find this a bit odd since they only defined Booleen and no Boolean. (not even speaking about BOOLEAN, booleen ...)
|
|
-
-
-
H|B


- Joined on 03-28-2007
- Posts 59
|
Extending Booleen:
typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1, verdadeiro=1, Verdadeiro=1, VERDADEIRO=1, falso=0, Falso=0, FALSO=0} Booleen
#define TRUE (TRWTF == PHP)
|
|
-
-
-
Daid


- Joined on 01-30-2007
- Posts 282
|
XIU:Isn't BOOL just defined as int?
Kinda depents on your world. I think in C it is. In Java it's a primitive right? with the boolean object version. In VB it's a own type, lua has a boolean type, so has php. Most insane version I've seen was in some C++ code, in which BOOL was an class, with it's own factory. C# has FILE_NOT_FOUND ;-) as extra option in the boolean.
|
|
-
-
derula


- Joined on 06-15-2007
- Posts 282
|
H|B:Extending Booleen:
typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1, verdadeiro=1, Verdadeiro=1, VERDADEIRO=1, falso=0, Falso=0, FALSO=0} Booleen
oh, and while you're on it, you can also make it: typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1, verdadeiro=1, Verdadeiro=1, VERDADEIRO=1, falso=0, Falso=0, FALSO=0, WAHR=1, Wahr=1, wahr=1, FALSCH=0, Falsch=0, falsch=0} Booleen
# The Brillant Paula Bean # Author:: derula # Copyright:: Copyright (c) 2005-2008 Paula Bean # License:: Originally distributed under a # proprietary license by Paula Bean. # Ruby port by derula published # under the same terms as Ruby's.
# This module provides a method to return the # brillance of Paula Bean. This can be achieved # by calling the module method get_paula. module Paula_Bean
# This constant stores the essence of Paula # Bean's brillance. This is a private # constant, so you MAY NOT use # Paula_Bean::PAULA to access it! Please use # the get_paula method instead. PAULA = "Brillant"
# Returns Paula Bean's brillance. def self.get_paula return PAULA end end
|
|
-
-
operagost


- Joined on 03-19-2007
- Pennsylvania, USA
- Posts 219
|
typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1, dossier_non_trouvé=2, file_not_found=2} Booleen; Fixed...
|
|
-
-
-
Talchas


- Joined on 09-05-2006
- Posts 25
|
yoz-y:#define TRUE (1 == 1) <= ow my eyes
#define boolean int <= what ?
Actually, this isn't that bad (in C) - the best you can do for a boolean is some sort of integer type, and (1==1) is the best way to define true if you need to do so, because the value of (1==1) is only guaranteed to be nonzero (I think). So if you want "return TRUE" to be consistent with true-false generated by the comparison ops, this is a good way to do it.
now in my college they took a different approach :
(found in a C source file we had to work on on C classes)
typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1} Booleen; Not only they managed to handle the personal preferences of everybody. They also happened to provide both French and English wordings. I find this a bit odd since they only defined Booleen and no Boolean. (not even speaking about BOOLEAN, booleen ...)
Now thats just WTF.
|
|
-
-
Lingerance


- Joined on 07-24-2007
- Posts 857
|
Exteris:# define FALSE = (SwampSearch('Foo') == SwampSearch('Foo'))
Sweet I've always wanted to be able to do:
Booleen done FALSE; //Reads funny
while (!done) {
//Eat pie and waffles
}
But alas, even with your generously provided code my program hangs during the "Booleen done FALSE". Please email me the codes, kind sir.
irc://irc.slashnet.org/#TDWTF "You acquaint the SURLY THUGS with your brand of diplomacy."
|
|
-
-
-
-
vt_mruhlin


- Joined on 03-01-2007
- Austin, TX
- Posts 436
|
Oooh, ooh, the other day I wanted to post this but forgot. From some legacy C code, there were a number of functions declared as follows:
PRIVATE int fooBar()
"Wait a minute... These are global scope. How can they be private?"
About 30 minutes of code searching later:
#define PRIVATE static
|
|
-
-
dhromed


- Joined on 04-13-2005
- Dutchland
- Posts 2,614
|
vt_mruhlin:Oooh, ooh, the other day I wanted to post this but forgot. From some legacy C code, there were a number of functions declared as follows:
PRIVATE int fooBar()
"Wait a minute... These are global scope. How can they be private?"
About 30 minutes of code searching later:
#define PRIVATE static
That's just malicious.
— Flurp.
|
|
-
-
Lingerance


- Joined on 07-24-2007
- Posts 857
|
dhromed: vt_mruhlin:Oooh, ooh, the other day I wanted to post this but forgot. From some legacy C code, there were a number of functions declared as follows:
PRIVATE int fooBar()
"Wait a minute... These are global scope. How can they be private?"
About 30 minutes of code searching later:
#define PRIVATE static
That's just malicious.
//From winuser.h
WINUSERAPI
int
WINAPI
ToUnicodeEx(
UINT wVirtKey,
UINT wScanCode,
PBYTE lpKeyState,
LPWSTR pwszBuff,
int cchBuff,
UINT wFlags,
HKL dwhkl);
Not exactly the same as unsing a keyword, but really what's the point of having them when the user already knows they are reading a windows header file?
irc://irc.slashnet.org/#TDWTF "You acquaint the SURLY THUGS with your brand of diplomacy."
|
|
-
-
rox_midge


- Joined on 12-20-2007
- Posts 16
|
Lingerance: //From winuser.h ... ToUnicodeEx
Not exactly the same as unsing a keyword, but really what's the point of having them when the user already knows they are reading a windows header file?
Visual Studio's Intellisense will display the comment immediately preceeding a function declaration when that function's intellisense popup appears.
So, in this case, when you type the open paren in "ToUnicodeEx(", you get a popup that gives you the function signature as well as telling you from which header it came. Not horribly useful, considering that there's a quick context option to go to the definition, and a better solution would be to always display the filename where the function was defined, but that's the rationale, anyway.
|
|
-
-
Soviut


- Joined on 09-13-2007
- Posts 106
|
In Maya, the MEL scripting language and command line system interpret as follows:
False = false, 0, off True = true, 1, on And depending on who maintained that part of the documentation, they're all used interchangeably. It actually makes sense in a lot of situations though since certain options are really being turned "off" while others are being falsified. When the animators who have no coding experience see "off" they know what it means.
|
|
-
-
MarcB


- Joined on 10-24-2006
- Posts 511
|
Lingerance:
Booleen done FALSE; //Reads funny
while (!done) { //Eat pie and waffles }
I always liked the "fun with unix command lines" stuff. Things like: % got a light? No match. % man woman No manual entry for woman
-- Never play leapfrog with a unicorn
|
|
-
-
-
gremlin


- Joined on 01-05-2006
- Posts 56
|
operagost:typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1, dossier_non_trouvé=2, file_not_found=2} Booleen; Fixed...
Actually that should be fichier_non_trouvé.
the forum software ate my colon
|
|
-
-
aib


- Joined on 01-03-2007
- Posts 87
|
Talchas: yoz-y:#define TRUE (1 == 1) <= ow my eyes
#define boolean int <= what ?
Actually, this isn't that bad (in C) - the best you can do for a boolean is some sort of integer type, and (1==1) is the best way to define true if you need to do so, because the value of (1==1) is only guaranteed to be nonzero (I think). So if you want "return TRUE" to be consistent with true-false generated by the comparison ops, this is a good way to do it.
Nah, such operators yield either 0 or 1 (I had to check the standards myself). (C90 §6.3.8 or C99 §6.5.9) asuffield's got a point, though -- it's practical. typedef enum{FAUX=0, Faux=0, faux=0, FALSE=0, False=0, false=0, VRAI=1, Vrai=1, vrai=1, TRUE=1, True=1, true=1} Booleen; Not only they managed to handle the personal preferences of everybody. They also happened to provide both French and English wordings. I find this a bit odd since they only defined Booleen and no Boolean. (not even speaking about BOOLEAN, booleen ...)
For true multi-language support, they should do:
typedef enum { ... } Boolean, Booleen, IkiDegerli, <translation>, <translation>, ...;
I may or may not have meant what I've said above.
|
|
-
-
Eternal Density


- Joined on 03-25-2007
- Posts 306
|
what about baleen while we're at it?
300 posts! This is Spar... dang I just lost the game. Legendary Threadlolwtf: Instead of comfy chair, package contained bobcat. Would not buy again. curtmack: It's like Godwin's Law, but instead of Hitler it's xkcd references. morbiuswilters: Right, but the Holocaust wasn't nearly as bad as xkcd.
|
|
-
-
-
Eternal Density


- Joined on 03-25-2007
- Posts 306
|
Or we could use base 1. 1 is 1 and 0 is
300 posts! This is Spar... dang I just lost the game. Legendary Threadlolwtf: Instead of comfy chair, package contained bobcat. Would not buy again. curtmack: It's like Godwin's Law, but instead of Hitler it's xkcd references. morbiuswilters: Right, but the Holocaust wasn't nearly as bad as xkcd.
|
|
-
-
m0ffx


- Joined on 08-15-2006
- Posts 561
|
1 is 1, 0 does not exist, the base-1 system is non positional. Counting goes 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 111111111, and so on.
TRWTF is Community Server
|
|
-
|
|