Pages: [1] 2 3
  Print  
Author Topic: Some things just have to be deprecated  (Read 8706 times)
Offline (Unknown gender) ludamad
Posted on: November 23, 2008, 01:56:12 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
GML as it is in GM should definitely only be in a special compatibility mode. Instead, the real EDL language should have some more logical restrictions, and better organization of functions.

GM Code:

if variable_local_exists("Counter")
{
Counter+=1
ds_list_add(myList,Counter)
}
else
{
Counter=0
myList = ds_list_create()
}

EDL Equivalent
//Static variables are used instead, this code can be thought of 'only executing the first time', it is not set to 0 every time it is run

static int Counter = 0;//=0 is optional, in C++ static variables are always initialized to 0
static list myList; //creates an empty list if one is not created
Counter++
push(myList,Counter)
« Last Edit: November 23, 2008, 02:02:29 PM by ludamad » Logged
Offline (Male) Rusky
Reply #1 Posted on: November 24, 2008, 07:36:54 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
for now:
Code: [Select]
cpp { static counter; }for later, static would be marvelous
Logged
Offline (Unknown gender) ludamad
Reply #2 Posted on: November 24, 2008, 08:53:30 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
Don't you mean:
cpp{static int counter;}
Logged
Offline (Male) RetroX
Reply #3 Posted on: November 25, 2008, 03:40:12 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
I don't see why this should go in "ENIGMA Einsteins."

In fact, I don't know why we even have three different forums to ask for help.

The forums are turning into the GMC.
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) ludamad
Reply #4 Posted on: November 25, 2008, 04:41:00 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
EDL design is an issue that only ENIGMA Einsteins can discuss, duh.
Logged
Offline (Male) Rusky
Reply #5 Posted on: November 25, 2008, 05:28:26 PM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
whatever static int static notint whatever.


But yeah, how about just one forum for discussion plz? At least atm, there really is no need for more. maybe 2.
Logged
Offline (Male) notachair
Reply #6 Posted on: November 26, 2008, 12:41:40 AM

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

View Profile
Quote from: Rusky
But yeah, how about just one forum for discussion plz? At least atm, there really is no need for more. maybe 2.
wut

>_>

<_<

<_>
« Last Edit: November 27, 2008, 04:57:13 AM by a2h » Logged
Offline (Unknown gender) Game_boy
Reply #7 Posted on: November 27, 2008, 04:48:57 AM
Member
Joined: Apr 2008
Posts: 228

View Profile
ENIGMA has to be fully Game Maker compatible otherwise its use will be confined to a very small group. We need to have ENIGMA as a drop-in replacement that any GM user could pick up and understand. The only visible difference to the average user should be the gamemaker_registered=1 constant.

I fail to see how your thing couldn't be done using the C++ tags.
Logged
Offline (Male) Rusky
Reply #8 Posted on: November 27, 2008, 10:46:36 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
allowing things besides var would leave it just as backwards compatible, it would just also add new features.
Logged
Offline (Unknown gender) Game_boy
Reply #9 Posted on: November 27, 2008, 11:40:53 AM
Member
Joined: Apr 2008
Posts: 228

View Profile
allowing things besides var would leave it just as backwards compatible, it would just also add new features.

If that was in reply to me, I know that. I'm only against 'deprecation', i.e. not being able to even use the previous format.
Logged
Offline (Unknown gender) ludamad
Reply #10 Posted on: November 27, 2008, 04:23:15 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
Deprecated means discouraged but still supported; alternatives will be preferred, and you need to specify that you want to turn deprecation warnings off, and then you can GM all you want. However, you might accidentally do something like attach an interpreter to your executable (how else will josh do execute_string?).
Logged
Offline (Male) Rusky
Reply #11 Posted on: November 28, 2008, 10:32:59 AM

Resident Troll
Joined: Feb 2008
Posts: 960
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
a compiler instead!
Logged
Offline (Male) Josh @ Dreamland
Reply #12 Posted on: November 30, 2008, 12:13:35 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
I fear you'll find static doesn't get along with instances.
Stays the same after you delete an instance and recreate it.

In other words
Abandon all hope.
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) ludamad
Reply #13 Posted on: November 30, 2008, 01:05:38 PM
Developer
Joined: May 2008
Posts: 1256

View Profile Email
Just as good would be if localv int Counter = 0; was placed in the constructor - that is, the variable was initialized in the constructor instead of the code piece.
Logged
Offline (Male) Josh @ Dreamland
Reply #14 Posted on: November 30, 2008, 01:31:12 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2946

View Profile Email
Well, localv was meant to be used in create, but I could rig static to behave like localv except in constructor. That's only if I have to, though.

Using localv in the create event is virtually the same thing. The create event's been bouncing in and out of the constructor in my mind, but it actually is in the constructor in R3. (It won't be next release, because it'd save time to call it in instance_create instead of checking that we aren't in a room create later. If it's in a room create, I need to make sure all the instances exist before calling create events, I think. I need to run tests...)
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
Pages: [1] 2 3
  Print