Vote me down

1 view
Skip to first unread message

jayCampbell

unread,
Apr 6, 2008, 3:10:31 PM4/6/08
to Ecmanomic
Both my current proposals are bunk.

abl...@gmail.com

unread,
Apr 7, 2008, 8:25:12 PM4/7/08
to Ecmanomic
On Apr 6, 12:10 pm, jayCampbell <jaycampb...@gmail.com> wrote:
> Both my current proposals are bunk.

I'm afraid the third one is, too. You need to refer to the game
object as "this", not "GameData", for it to work on the server. The
client has global variables like GameData, but the server does not, in
order to prevent code in subgames from messing with the outer game.

Please feel free to add this to the game docs! :)

I'll vote for all your proposals anyway; activating them shouldn't
cause any harm, and it will allow them to roll off the voting booth
and eventually the entire docket.

--abliss

jayCampbell

unread,
Apr 7, 2008, 9:00:58 PM4/7/08
to Ecmanomic
> I'm afraid the third one is, too. You need to refer to the game
> object as "this", not "GameData", for it to work on the server.

Doh. Resubmitted as unpropose_v2.

abl...@gmail.com

unread,
Apr 7, 2008, 11:16:36 PM4/7/08
to Ecmanomic
Looks better. Again, I'll vote for it because it doesn't do any harm,
but I don't think it will quite work. I could be wrong about the way
javascript works, but I think that "delete" does not remove all
references to the object in question, only the one reference passed to
"delete". So for example,

var a = {b:2};
var c = a.b;
delete c;
a.b == 2;

So I think you need to do something like "delete
this.Proposal.docket[propObj.name]".

I activated phagocytosis2; if it doesn't work for you please let me
know what browser and OS you are running. You can still submit all
actions to http://ecmanomic.org/ecmanomic.cgi even if the frontend
won't load in your browser.

--abliss

abl...@gmail.com

unread,
Apr 7, 2008, 11:19:45 PM4/7/08
to Ecmanomic
On Apr 7, 6:00 pm, jayCampbell <jaycampb...@gmail.com> wrote:
PS: I tested your proposal in my sandbox and my suspicions were
confirmed. Probably it isn't clear how to do sandbox testing --
essentially you play out the proposal, voting, and activation stages
using the "local run" button, then test that the game is in the right
state (in this case, by proposing another test proposal, and then
trying to unpropose it). Suggestions or direct improvements to the
docs would be most welcome.

--abliss

jayCampbell

unread,
Apr 7, 2008, 11:40:14 PM4/7/08
to Ecmanomic
> "delete" does not remove all references to the object in question,
> only the one reference passed to "delete".

I've been deep in Ruby for a month, where nearly everything is pass-by-
object.

Fixed and submitted as v3. I'll start sandboxing and take notes for
the docs.
Reply all
Reply to author
Forward
0 new messages