Branch: Tag:

2001-02-05

2001-02-05 11:47:48 by Per Hedbor <ph@opera.com>

Added _m_delete, it's now possible to overload the m_delete() function in objects

Rev: src/builtin.cmod:1.17
Rev: src/program.c:1.290
Rev: src/program.h:1.114

271:   //! @seealso   //! @[mappingp()]   //! - PIKEFUN 1 m_delete(mapping(mixed:1=mixed) map, mixed index) + PIKEFUN mixed m_delete(object|mapping map, mixed index)    efun;    optflags OPT_SIDE_EFFECT;   { -  +  /*FIXME: Should be +  * type function(mapping(1=mixed:2=mixed),1:2)| +  * function(object,mixed:mixed); +  * +  * or similar +  */ +  if( map->type == T_MAPPING ) +  {    struct svalue s; -  map_delete_no_free(map, index, &s); +  map_delete_no_free(map->u.mapping, index, &s);    pop_n_elems(args);    *sp=s;    sp++;    } -  +  else +  { +  apply_lfun( map->u.object, LFUN__M_DELETE, 1 ); +  stack_swap(); +  pop_stack(); +  } + }      //! Returns 1 if the weak flag has been set for @[m].   //!