Pages: « 1 2 3 »
  Print  
Author Topic: Alternate to cpp {}  (Read 8715 times)
Offline (Male) Rusky
Reply #15 Posted on: November 03, 2008, 06:36:43 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
What if cpp{} is consistent with all the other keyword syntax block structures and so all your syntax ideas are just making things more complicated?
okay, but the point is to allow split-up blocks which isn't consistent with "all the other keyword syntax block structures"
Logged
Offline (Male) Josh @ Dreamland
Reply #16 Posted on: November 16, 2008, 08:44:39 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
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
Code: [Select]
if a=b {} You get a compile error?
So when you say
Code: [Select]
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
Offline (Unknown gender) score_under
Reply #17 Posted on: November 19, 2008, 06:10:06 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
asm{}, but no one's touched that.

...

I don't see the point in using cpp {} at all

...

Code: [Select]
if (a=b) {} It sets a to b, then checks if b > 0?
Those don't sound like very fun problems to encounter.
I've used asm(), but not EDL's asm{} before. I would use C++ in those cases where I can't wait for the next enigma update, and if I ever wrote an "if" like that and DIDN'T mean what C++ would interpret it as, I would spear myself with the nearest knife. Seriously, it's a bad coding habit.
Logged
Offline (Male) Josh @ Dreamland
Reply #18 Posted on: November 30, 2008, 10:22:13 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
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
Offline (Male) qc.zackf
Reply #19 Posted on: August 03, 2009, 12:01:46 AM

Member
Location: Winter Haven, FL - USA
Joined: Aug 2009
Posts: 41

View Profile Email
I think it's perfect how it is.  It really doesn't need to be any more simplified:

Code: [Select]
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...
Offline (Male) Rusky
Reply #20 Posted on: August 03, 2009, 12:48:26 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
cout << "bla" << i << "bla";
+ doesn't work with c++ string literals.
Logged
Offline (Male) Josh @ Dreamland
Reply #21 Posted on: August 05, 2009, 11:03:26 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
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
Offline (Male) qc.zackf
Reply #22 Posted on: August 05, 2009, 11:13:12 AM

Member
Location: Winter Haven, FL - USA
Joined: Aug 2009
Posts: 41

View Profile Email
cout << "bla" << i << "bla";
+ doesn't work with c++ string literals.

I've been using C# for way too long...  :-\
Logged
Only ask questions you know the answer to...
Offline (Male) RetroX
Reply #23 Posted on: August 05, 2009, 03:04:25 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
I've been using C# for way too long...  :-\
Wash your hands, mouth, and brain with soap.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #24 Posted on: August 05, 2009, 04:53:40 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
C#'s not evil, silly.
Logged
Offline (Male) Josh @ Dreamland
Reply #25 Posted on: August 07, 2009, 07:21:11 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
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
Offline (Male) Rusky
Reply #26 Posted on: August 07, 2009, 10:29:33 AM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Since it's garbage collected, on a unified framework, has a lot of cool features, isn't becoming a giant language full of crap nobody wants like C++0x, types are nicer (e.g. no 0 == false crap), and it still lets you drop into "unmanaged" code.
Logged
Offline (Male) RetroX
Reply #27 Posted on: August 07, 2009, 10:35:50 AM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
It's not cross-platform, and Microsoft's way of ripping off C++, so it's instantly uncool.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #28 Posted on: August 07, 2009, 12:12:32 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
The language is cross-platform. .NET may not be, but the language itself is.
And it's not "ripping off C++". C++ is a giant, mangled, brain-dead version of C. It's intended for a different area. C# is more "ripping off" Java, if it's ripping off anything. And ripping off Java is fine.
Logged
Offline (Unknown gender) luiscubal
Reply #29 Posted on: August 09, 2009, 01:01:59 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
One word: Mono
Logged
Pages: « 1 2 3 »
  Print