View Issue Details

IDProjectCategoryView StatusLast Update
0000311LDMud 3.5Otherpublic2011-02-14 01:00
ReporterlarsAssigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Summary0000311: Object handles
DescriptionShort: Patch for handles
Date: Tue, 6 Jul 1999 21:57:09 +0200 (CEST)
From: vondincklage <daniel@ozet.de>
Type: Patch
State: Unclassified


> Dann ist dev.110 nichts fuer dich :-)
Das hatte ich mir schon fast so gedacht. Naja, bei mir sind eh genug
Aenderungen drin, das es mit den "offiziellen" Versionen nicht laeuft.

> Was macht dieser Typ denn?
Hm. Was macht der Typ. Ich verwende den z.zt. fuer zwei "sub"-Datentypen.
Vitems (Details) und Messagegruppen.
Beide haben die Eigenschaft, das sie von externen Servern ziemlich oft
durch die Gegend geschoben werden. Und da ist es etwas aufwendig und
Fehleranfaellig, dann immer ein Array ({objekt,ident in dem jeweiligen
Objekt}) zu verwenden.
Insofern ist es praktisch, da gleich einen Datentyp zu haben den man per
== vergleichen kann, den man kopieren kann usw.
Und ein anderer Sinn (Der zwar nicht so furchtbar elegant, aber trotzdem
praktisch ist ;-)) is, ne Art "Multiple-Dispatch fuer Arme". Will sagen,
es geht dann z.B:
 vitem pong;
 pong = add_vitem( ([ V_GENDER : "maennlich", V_LONG: "blah",
                      V_NAME : "blubb" ]));

 pong->set_long("foo");

... und schon aendert man die Long des Vitems. Intern wird im call_other
 das set_long in ein vitem_set_long( vitem who, ... );
 umgewandelt, so das man auch weiss wer/was gemeint ist ;-)
In naeherer Zukunft will ich dann auch die Count-Items auf die Art und
Weise machen.
Ich gebe gerne zu, das das weder elegant noch irgendwas anderes ist, aber
es raeumt teilw. den Code enorm auf.


Daniel von Dincklage (vonDincklage@ozet.de)
TagsNo tags attached.

Relationships

child of 0000688 resolvedGnomi LDMud 3.6 Lightweight objects 

Activities

2004-11-27 01:25

 

p-990710-0.gz (22,542 bytes)

zesstra

2009-10-02 10:01

administrator   ~0001421

I don't understand, what the goal and behaviour exactly is here... But the given example with that vitems does not specific new types...

fufu

2009-10-02 15:35

manager   ~0001431

I've skimmed the patch (which is incomplete - new files like handle.c are not included, and contains unrelated changes as well).

As far as I can make out, a handle is a triple of a type tag (hard-coded in the patch), an object (the handler) and an id. call_others are redirected to the handler, with a prefix added to the function name that depends on the type tag. The id, which can be a string or a number, is used for comparing handles.

Efuns:
  handle create_handle( object handler, string|int id, int type );
  object object_value( handle );
  mixed ident_value( handle );
  int handle_type( handle );

It seems to complicated to be added to the driver, and it overlaps with structs. (If we want to steal an idea, call_others on structs could be passed to registered handlers for their struct type.)

zesstra

2009-10-05 17:27

administrator   ~0001471

Thank you. I would also rather take the route in struct direction.

But I still don't understand the example with that vitems. (Maybe because I have no clue, what a vitem is or does.) What is so special about changing an object's title by calling a set_long(foo) and creating and configuring it as described?

Issue History

Date Modified Username Field Change
2004-11-27 01:25 lars New Issue
2004-11-27 01:25 lars File Added: p-990710-0.gz
2009-10-02 10:01 zesstra Note Added: 0001421
2009-10-02 10:01 zesstra Status new => feedback
2009-10-02 15:35 fufu Note Added: 0001431
2009-10-05 09:33 Gnomi Relationship added child of 0000688
2009-10-05 17:27 zesstra Note Added: 0001471
2009-10-27 08:56 zesstra Project LDMud => LDMud 3.5
2011-02-14 01:00 zesstra Status feedback => closed
2011-02-14 01:00 zesstra Resolution open => won't fix