Branch: Tag:

2003-04-27

2003-04-27 12:08:37 by Martin Nilsson <mani@lysator.liu.se>

Updated object_program type and added some mysterious documentation

Rev: src/builtin_functions.c:1.485

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.484 2003/04/14 15:04:41 mast Exp $ + || $Id: builtin_functions.c,v 1.485 2003/04/27 12:08:37 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.484 2003/04/14 15:04:41 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.485 2003/04/27 12:08:37 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
2602:    }   }    - /*! @decl program object_program(mixed o) + /*! @decl program|function object_program(mixed o)    *! -  *! Return the program from which @[o] was instantiated. +  *! Return the program from which @[o] was instantiated. If the +  *! object was instantiated from an unnamed program, the +  *! generating function will be returned. E.g. +  *! @expr{object_program(class { }())@} will return the @i{function@} +  *! "class {}".    *!    *! If @[o] is not an object or has been destructed @expr{0@} (zero)    *! will be returned.
7833:    tFunc(tPrg(tObj),tPrg(tObj)),    tFunc(tArray,tArray)),OPT_EXTERNAL_DEPEND);    - /* function(mixed:program) */ -  ADD_EFUN2("object_program", f_object_program,tFunc(tMix, tOr(tPrg(tObj),tObj)), +  /* function(mixed:program|function) */ +  ADD_EFUN2("object_program", f_object_program, +  tFunc(tMix, tOr(tPrg(tObj),tFunction)),    OPT_TRY_OPTIMIZE, fix_object_program_type, 0);      /* function(mixed:int) */