- Home /
if(!something) doesn't work in Boo, why?
When I want to check if something is true or false in an if() statement in JavaScript I just go if(something) or if(!something).
if(!something) doesn't work in Boo apparently, it gives this error: Assets/Code/Boo Creation.boo(9,12): BCE0044: unexpected char: '!'.
What is the proper way to do this in Boo? Thank you.
Answer by Xathos · Mar 07, 2011 at 01:48 AM
I'm kind of surprised that no one has really answered this yet...
if not something:
DoSomething()
I should also add that although there isn't all that much documentation for Boo itself, this shouldn't prove to be too much of a barrier: Boo is a CLI language with Python inspired syntax. Thus, boo behaves like C#, and shares the same API (if with different keywords), while it's syntax is practically identical to Python. If you're interested in using Boo, first learn python (an awesome language in and of itself), and then go to boo.codehaus.org to get up to speed on the (few) syntactic differences with python.
The only real impediment with learning boo is the syntax, as mechanically, it's practically identical to C# and UnityScript.
For the record, @Proclyon had came up with this... Though in a more complicated and uncertain fashion.
Answer by Justin Warner · Dec 13, 2010 at 03:19 PM
http://boo.codehaus.org/Part+03+-+Flow+Control+-+Conditionals
Would it be if(something != true)??
Not much documentation on the Boo language...
Also, http://boo.codehaus.org/BooManifesto.pdf
Check page 8, their's an example saying: if not __
That might help as well, good luck!
Also, not going to lie... I'd highly advise not using Boo... It's not documented, barely any users use it, and unless you actually know the language, then it'd be completely pointless to use it... Support is slim... Sorry.
I suppose if(something!=true) would work but I didn't think I'd have to do it that way. I really don't like the "if not something" that Boo uses, but I guess there won't be a language I like everything about. Thanks.
Sorry, C and Java both have many work arounds to things, and most languages share the same syntax, but are also different, you just have to work with them enough to fully understand it I guess... But oh well, good luck none-the-less.
haha , the only reason I even knew it was a code language (I think) is because I noticed it in the drop down menu's of the script reference site when I was replacing the JS samples for C# :F
Answer by Proclyon · Dec 13, 2010 at 03:17 PM
From:http://boo.codehaus.org/Part+06+-+Operators
Logical Not "not a" Only use when a is a boolean value
Never used boo, just googled your question and found it in about 30 seconds. Just wondering, does it work?
Your answer
![](https://koobas.hobune.stream/wayback/20220613090854im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Shields 'always' inactive. Player object doesn't recognise if child exists(Solved) 1 Answer
Detect perimetral walls of a room 1 Answer
Spawn Object If Boolean Equals True, Boolean Set To True On Level Load 1 Answer
Error : Animator has not been initialized. UnityEngine.Animator:SetBool(String, Boolean) 1 Answer
Help needed on c# code which all of you will find basic apart from me 1 Answer