Pages: [1]
  Print  
Author Topic: #RESOLVED# unable to parse (obj.variable) = value;  (Read 963 times)
Offline (Male) polygone
Posted on: January 27, 2011, 02:37:41 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 809

View Profile
GM is able to parse:

Code: [Select]
(obj.variable) = value;Whereas Enigma appears unable.


Tracker Reference:
http://enigma-dev.org/tracker/ticket.php?id=81
« Last Edit: March 05, 2011, 10:41:00 AM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Josh @ Dreamland
Reply #1 Posted on: January 28, 2011, 12:44:45 AM

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

View Profile Email
I was under the impression the syntax was strictly as follows:
Code: [Select]
(obj).variable = value;

If GM is suddenly allowing that sort of thing, I will remove all checks related to assignment operators. That will add compatibility with stream structures like cout, anyway.
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) polygone
Reply #2 Posted on: January 28, 2011, 08:13:12 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 809

View Profile
I was under the impression the syntax was strictly as follows:
Code: [Select]
(obj).variable = value;

If GM is suddenly allowing that sort of thing, I will remove all checks related to assignment operators. That will add compatibility with stream structures like cout, anyway.
It's always allowed that sort of thing. It doesn't care about the brackets:

Code: [Select]
(((((script())).meh.hello))) = (script().derp);
(variable) = value;

It's all perfectly valid. Only thing that isn't valid is:

Code: [Select]
variable.(loc) = value
« Last Edit: January 28, 2011, 08:24:58 AM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: January 28, 2011, 08:26:46 AM

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

View Profile Email
Neither does C++. But C++ lets you do this:

Code: (C) [Select]
function() = script(); //GM doesn't have references
(double&)varname = 10; //GM doesnt have types
++varname = 12; //GM doesn't have ++
(expression1,expression2,varname) = 10; // GM doesn't allow coma separation in expressions
var + 1; // Error: Assignment operator expected
cout << 1; //Error: Assignment operator expected

So it became a question of how messed up I wanted to allow the syntax to be.
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]
  Print