View Issue Details

IDProjectCategoryView StatusLast Update
0000507LDMud 3.5LPC Languagepublic2011-02-20 02:00
Reportersinnvoll Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Summary0000507: An efun " this_closure() ", that returns in a closure a pointer to the closure.
DescriptionIt would be nice to have an efun this_closure(), that returns in a closure a pointer to the closure.

add_controller("notify_move",
               function void ()
               {
                  write("Write this only for exact one move.");
                  delete_controller("notify_move",this_closure());
               }
);

You could code something like this:

closure cl;

add_controller("notify_move",
               cl=function void ()
                  {
                     write("Write this only for exact one move.");
                     delete_controller("notify_move",cl);
                  }
);

But that has the disadvantage of a recursive data structure.
The memory might not be freed, if the closure is no longer used,
because the reference count can't be nulled because of the self reference.
   
TagsNo tags attached.

Relationships

duplicate of 0000288 new New efun this_function() 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2007-08-06 07:56 sinnvoll New Issue
2011-02-20 01:57 zesstra Relationship added duplicate of 0000288
2011-02-20 02:00 zesstra Project LDMud => LDMud 3.5