ENIGMA Forums
General fluff => General ENIGMA => Topic started by: RetroX on October 25, 2008, 08:37:33 pm
-
Wouldn't it be better to make the cpp {} statement into something like cpp <>? For example, I could not do something like this:
cpp {
if (somecode)
{
}
ENIGMA_function();
cpp {
}
}
While I could like this:
cpp <
if (somecode)
{
>
ENIGMA_function();
cpp <
}
>
Just a suggestion. This is used in PHP very often, and I think ENIGMA's C++ should act the same way.
-
[code]
Use that.[/code]
-
It wouldn't work RetroX because C++ is not php.
You just cant do it because to convert it it would just end up being the exact same because C++ doesn't support< > and it would just make the compiler error. :'(.
-
It wouldn't work RetroX because C++ is not php.
You just cant do it because to convert it it would just end up being the exact same because C++ doesn't support< > and it would just make the compiler error. :'(.
What now? As far as I know, cpp { } is not valid C++ either. It'll have been preparsed before it's compiled.
BUT
cpp <
if(a>b)
{
cout<<"Something";
}
>
Would fail.
So, I suggest something like
cpp {{
if(a)
{
if(b)
{
thingy();
}
}
}}
(where 2 braces in a row on the same line with nothing in between ends it)
-
Engima (As far as i know)When it converts removes the cpp{} as it is no longer required.
-
I suggest finding a symbol not used in C++. | maybe? (not sure if that's used or not)
-
I suggest finding a symbol not used in C++. | maybe? (not sure if that's used or not)
http://www.learncpp.com/cpp-tutorial/38-bitwise-operators/
| is used in C++.
-
then < and > would be fine if you want something that's not C++.
As long as it isn't << or >>
-
Right, bitwise or. XD
< and > are used in C++, they're less than/greater than and for templates.
Just about every symbol is used by now...
maybe something more python/ruby like?
cpp
//cpp here
endcpp
or # or $ perhaps?
-
What about [cpp][/cpp]?
-
what if you use an array and have an index stored in cpp?
-
You couldn't because cpp is a reserved keyword.
-
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?
-
What about cpp <{ }>?
-
What about cpp <{ }>?
Do we have a winner? :D
-
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"
-
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.
-
asm{}, but no one's touched that.
...
I don't see the point in using cpp {} at all
...
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.
-
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.
-
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.
-
cout << "bla" << i << "bla";
+ doesn't work with c++ string literals.
-
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.
-
cout << "bla" << i << "bla";
+ doesn't work with c++ string literals.
I've been using C# for way too long... :-\
-
I've been using C# for way too long... :-\
Wash your hands, mouth, and brain with soap.
-
C#'s not evil, silly.
-
Since when?
-
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.
-
It's not cross-platform, and Microsoft's way of ripping off C++, so it's instantly uncool.
-
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.
-
One word: Mono
-
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.
The only reason people like C# is because Microsoft is good at marketing.
-
That's retardiculous. The reason people like C# is that they've used it and it's good.
-
Yep. C# is nice, just not developer friendly when it comes to cross-platform development. Damn Microsoft! Greedy bastards!
-
Microsoft seems to have lost their roots, a lot. Windows 98 was incredible for the time. 2000 wasn't as stable, but a much better OS. There are even some interface things XP should have had (audio preview in explorer, etc). Vista was feature-bloated and unstable. Windows 7 is great, but still quite bloated.
-
I'd like to openly commend Rusky for not joining in on you boys' little antiMS jackoffathon
If C# is just a rip of Java, it is at least an attempt to be a modernized rip
& let's keep it straight on the C#/.NET dichotomy
-
If C# is just a rip of Java, it is at least an attempt to be a modernized rip
I realize. It's still a rip, and the attempt was failed.
-
I realize. It's still a rip, and the attempt was failed.
*high five*
-
I realize. It's still a rip, and the attempt was failed.
*high five*
You're both pathetic. C# as a language is far better than Java. You're just blind because MICRO$0FT IS TEH SUX0RZ DURRRRRR
-
You're both pathetic. C# as a language is far better than Java. You're just blind because MICRO$0FT IS TEH SUX0RZ DURRRRRR
No, you're blind to our thoughts because you think we're blind because you think we think Microsoft sucks. ;)
-
Duh! You haven't even given any thoughts! If you want to give some I might be able to see them. I've actually used C#. Have you? I've actually used Java as well. How about you? Both? Somehow I doubt it after this conversation.
-
I've used C# and I can vouch for both its flexibility and ease of use. However narrow minded thoughts like yours are just giving C# and .NET a bad name .NET has been the brainchild of many developers spreading across several companies (Intel and Sun being two) Microsoft's take on .NET is it's own and Sun is actually working on creating it's own version.
Also C# was not and is not and M$ only thing both Sun and Intel have had a say in it's creation although M$ did most of it's development.