Pages: 1 2 3 »
  Print  
Author Topic: Alternate to cpp {}  (Read 8706 times)
Offline (Male) RetroX
Posted on: October 25, 2008, 08:37:33 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
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.
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) notachair
Reply #1 Posted on: October 25, 2008, 10:24:09 PM

Definitely not a chair
Contributor
Joined: Feb 2008
Posts: 299

View Profile
Code: [Select]
[code]Use that.[/code]
Logged
Offline (Unknown gender) death-droid
Reply #2 Posted on: October 26, 2008, 02:05:22 AM
Member
Joined: Aug 2008
Posts: 19

View Profile
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. :'(.
« Last Edit: October 26, 2008, 02:14:58 AM by death-droid » Logged
Offline (Unknown gender) score_under
Reply #3 Posted on: October 26, 2008, 03:57:19 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
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)
Logged
Offline (Unknown gender) death-droid
Reply #4 Posted on: October 26, 2008, 05:23:25 PM
Member
Joined: Aug 2008
Posts: 19

View Profile
Engima (As far as i know)When it converts removes the cpp{} as it is no longer required.
Logged
Offline (Male) Rusky
Reply #5 Posted on: October 27, 2008, 06:03:26 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
I suggest finding a symbol not used in C++. | maybe? (not sure if that's used or not)
Logged
Offline (Male) Kazuki
Reply #6 Posted on: October 27, 2008, 08:18:43 PM

Member
Location: Illinois, USA
Joined: Sep 2008
Posts: 1

View Profile WWW Email
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++.
Logged
Offline (Unknown gender) death-droid
Reply #7 Posted on: October 28, 2008, 12:26:52 AM
Member
Joined: Aug 2008
Posts: 19

View Profile
then < and > would be fine if you want something that's not C++.
As long as it isn't << or >>
Logged
Offline (Male) Rusky
Reply #8 Posted on: October 28, 2008, 06:13:11 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
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?
Code: [Select]
cpp
//cpp here
endcpp
or # or $ perhaps?
Logged
Offline (Male) RetroX
Reply #9 Posted on: October 28, 2008, 08:02:10 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
What about [cpp][/cpp]?
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 #10 Posted on: October 29, 2008, 06:15:43 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
what if you use an array and have an index stored in cpp?
Logged
Offline (Male) sprintf()
Reply #11 Posted on: October 29, 2008, 07:46:10 PM

"Past Contributor"
Location: S. Wales
Joined: Apr 2008
Posts: 72
MSN Messenger - dmgoron@gmail.com
View Profile Email
You couldn't because cpp is a reserved keyword.
Logged
Offline (Female) serprex
Reply #12 Posted on: November 02, 2008, 08:07:03 PM
Smooth ER
Developer
Joined: Apr 2008
Posts: 106

View Profile WWW
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?
Logged
Offline (Male) RetroX
Reply #13 Posted on: November 03, 2008, 03:38:18 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
What about cpp <{ }>?
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 (Unknown gender) score_under
Reply #14 Posted on: November 03, 2008, 03:45:17 PM

Member
Joined: Aug 2008
Posts: 308

View Profile
What about cpp <{ }>?
Do we have a winner? :D
Logged
Pages: 1 2 3 »
  Print