Branch: Tag:

1999-12-31

1999-12-31 01:53:58 by Martin Stjernholm <mast@lysator.liu.se>

Added new magic identifier "this_program". It behaves like a private
constant that is the current program. (Useful to refer to the same class
when it has no name.) Being private implies that it's the current lexical
program, as opposed to object_program(this_object()).

Rev: src/language.yacc:1.159
Rev: src/program.c:1.194
Rev: src/program.h:1.75

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.193 1999/12/29 21:22:47 mast Exp $"); + RCSID("$Id: program.c,v 1.194 1999/12/31 01:53:58 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
62:   #include "compilation.h"       + struct pike_string *this_program_string=0; +    char *lfun_names[] = {    "__INIT",    "create",
3221:    int i;    struct svalue key;    struct svalue val; +  +  MAKE_CONSTANT_SHARED_STRING(this_program_string,"this_program"); +     lfun_types = allocate_mapping(NUM_LFUNS);    key.type = T_STRING;    val.type = T_TYPE;
3245:   {    int e;    +  free_string(this_program_string); +     free_mapping(lfun_types);   #ifdef FIND_FUNCTION_HASHSIZE    for(e=0;e<FIND_FUNCTION_HASHSIZE;e++)