Ignore:
Timestamp:
Apr 17, 2011, 11:56:55 PM (10 years ago)
Author:
Sam Hocevar
Message:

lisp: implement LObject::Eval.

File:
1 edited

Legend:

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

    r494 r496  
    4848struct LObject
    4949{
     50    /* Factories */
     51    static LObject *Compile(char const *&s);
     52
     53    /* Methods */
     54    LObject *Eval();
    5055    void Print();
    5156
     57    /* Members */
    5258    ltype type;
    5359};
     
    5561struct LObjectVar : LObject
    5662{
     63    /* Factories */
    5764    static LObjectVar *Create(int index);
    5865
     66    /* Members */
    5967    int index;
    6068};
     
    6270struct LList : LObject
    6371{
     72    /* Factories */
    6473    static LList *Create();
    6574
     75    /* Methods */
    6676    size_t GetLength();
    6777
     78    /* Members */
    6879    LObject *cdr, *car;
    6980};
     
    7182struct LNumber : LObject
    7283{
     84    /* Factories */
    7385    static LNumber *Create(long num);
    7486
     87    /* Members */
    7588    long num;
    7689};
     
    7891struct LRedirect : LObject
    7992{
     93    /* Members */
    8094    LObject *ref;
    8195};
     
    8397struct LString : LObject
    8498{
     99    /* Factories */
    85100    static LString *Create(char const *string);
    86101    static LString *Create(char const *string, int length);
    87102    static LString *Create(int length);
    88103
     104    /* Methods */
    89105    char *GetString();
    90106
     107    /* Members */
    91108private:
    92109    char str[1]; /* Can be allocated much larger than 1 */
     
    155172struct LChar : LObject
    156173{
     174    /* Factories */
    157175    static LChar *Create(uint16_t ch);
    158176
     177    /* Members */
    159178    uint16_t ch;
    160179};
     
    162181struct LPointer : LObject
    163182{
     183    /* Factories */
    164184    static LPointer *Create(void *addr);
    165185
     186    /* Members */
    166187    void *addr;
    167188};
     
    169190struct LFixedPoint : LObject
    170191{
     192    /* Factories */
    171193    static LFixedPoint *Create(int32_t x);
    172194
     195    /* Members */
    173196    int32_t x;
    174197};
     
    186209long lfixed_point_value(void *c);
    187210void *lisp_atom(void *i);
    188 void *lcdr(void *c);
    189 void *lcar(void *c);
     211LObject *lcdr(void *c);
     212LObject *lcar(void *c);
    190213void *lisp_eq(void *n1, void *n2);
    191214void *lisp_equal(void *n1, void *n2);
    192 void *eval(void *prog);
    193215void *eval_block(void *list);
    194216void *eval_function(LSymbol *sym, void *arg_list);
    195217void *eval_user_fun(LSymbol *sym, void *arg_list);
    196 void *compile(char const *&s);
    197218void *assoc(void *item, void *list);
    198219void resize_tmp(int new_size);
Note: See TracChangeset for help on using the changeset viewer.