|
Josh @ Dreamland
|
|
Reply #16 Posted on: November 16, 2008, 08:44:39 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Nah, that's again, silly.
cpp {} is for people who are well-versed with C++. I assumed people would mostly leave it alone, as it's totally unnecessary at this point. It's for raw power when you need it, as is asm{}, but no one's touched that. (Go figure)
Think for a second, though. ENIGMA converts your games to C++, right? But you're asking what about running GM functions in cpp {}? They're run in C++ all the time. The only differences you'll encounter are with functions like min() and max(), as they only take two parameters in C++; along with instance_destroy() as it has to be passed the ID. (instance_destroy(id))
This doesn't go for with(), though, which is only in EDL. switch() and things are also different. This is why I don't see the point in using cpp {} at all, especially not like you just did. EDL is more versatile with if() statements and the sort, anyway. Why would you want to use cpp{} in there? So when you say
if a=b {} You get a compile error? So when you say
if (a=b) {} It sets a to b, then checks if b > 0? Those don't sound like very fun problems to encounter.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #18 Posted on: November 30, 2008, 10:22:13 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
then what's wrong with cpp { if() {} }?
For EDL'ers that aren't good with C++'s more picky syntax, they'll never need cpp{} around only a starting brace, unless they're just taking code from somewhere else, in which case they should still be versed enough as to use semicolons.
The only time it'd be nice to have cpp <> is for a complex C++ for loop, followed by a with statement. But I don't think we'll be seeing much of that.
Maybe if someone actually turns up a case where cpp <{}> would be useful... otherwise it's just more symbols to type. I suppose I could make it <{}> or {}, but...
I'll think about it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
qc.zackf
|
|
Reply #19 Posted on: August 03, 2009, 12:01:46 am |
|
|
Location: Winter Haven, FL - USA Joined: Aug 2009
Posts: 41
|
I think it's perfect how it is. It really doesn't need to be any more simplified:
cpp { for(i = 0; i < 9; i++) { cout<<"The for-loop looped "+i+" x's!\n"; } }
Just a "simple" example.
|
|
|
Logged
|
Only ask questions you know the answer to...
|
|
|
|
Josh @ Dreamland
|
|
Reply #21 Posted on: August 05, 2009, 11:03:26 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
As of R4, C++ is totally usable anyway. Meaning ++ and cout will both be available to you.
I may leave cpp {} in for people who understand parsed-EDL syntax, and are faced with a compile error that is not yet fixed.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #25 Posted on: August 07, 2009, 07:21:11 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Since when?
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
|
|
|