Ignore:
Timestamp:
Apr 17, 2011, 10:28:20 AM (11 years ago)
Author:
Sam Hocevar
Message:

lisp: populate LispSymbol? with symbol-related methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/lisp/lisp.h

    r483 r484  
    7171};
    7272
     73struct LispString : LispObject
     74{
     75};
     76
    7377struct LispSymbol : LispObject
    7478{
     79    static LispSymbol *Find(char const *name);
     80    static LispSymbol *FindOrCreate(char const *name);
     81
     82    void *GetName();
     83    void *GetFunction();
     84    void *GetValue();
     85
     86    void SetFunction(void *fun);
     87    void *SetValue(void *value);
     88    void *SetNumber(long num);
     89
    7590#ifdef L_PROFILE
    7691    float time_taken;
    7792#endif
    78     void *value, *function, *name;
     93    void *value, *function;
     94    LispString *name;
    7995    LispSymbol *left, *right; // tree structure
    8096};
     
    107123private:
    108124    LispObject *data[1];
    109 };
    110 
    111 struct LispString : LispObject
    112 {
    113125};
    114126
     
    147159void *lisp_eq(void *n1, void *n2);
    148160void *lisp_equal(void *n1, void *n2);
    149 LispSymbol *find_symbol(char const *name);
    150161long list_length(void *i);
    151162void lprint(void *i);
     
    155166void *eval_user_fun(LispSymbol *sym, void *arg_list);
    156167void *compile(char const *&s);
    157 void *symbol_value(void *symbol);
    158 void *symbol_function(void *symbol);
    159 void *set_symbol_number(void *symbol, long num);
    160 void *set_symbol_value(void *symbol, void *value);
    161 void *symbol_name(void *symbol);
    162168void *assoc(void *item, void *list);
    163169void resize_tmp(int new_size);
    164170void resize_perm(int new_size);
    165 LispSymbol *make_find_symbol(char const *name);
    166171
    167172void push_onto_list(void *object, void *&list);
     
    222227extern void l_obj_print(long number);  // exten lisp function switches on number
    223228
    224 
    225 
    226 #endif
     229// FIXME: get rid of this later
     230static inline void *symbol_value(void *sym) { return ((LispSymbol *)sym)->GetValue(); }
     231
     232
     233
     234#endif
Note: See TracChangeset for help on using the changeset viewer.