Ignore:
Timestamp:
May 11, 2011, 1:26:15 AM (11 years ago)
Author:
Sam Hocevar
Message:

lisp: merge the Lisp and LispGC classes and improve coding style.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/chars.cpp

    r635 r636  
    208208     if so report a conflict if any occur */
    209209  LSymbol *s=(LSymbol *)symbol;
    210   if (DEFINEDP(s->value) && (item_type(s->value)!=L_OBJECT_VAR))
     210  if (DEFINEDP(s->m_value) && (item_type(s->m_value)!=L_OBJECT_VAR))
    211211  {
    212212    ((LObject *)symbol)->Print();
    213213    lbreak("symbol already has a value, cannot instantiate an object varible");
    214214    exit(0);
    215   } else if (DEFINEDP(s->value))
    216   {
    217     int index=((LObjectVar *)s->value)->index;
     215  } else if (DEFINEDP(s->m_value))
     216  {
     217    int index = ((LObjectVar *)s->m_value)->m_index;
    218218    if (index<tiv)
    219219    {
     
    337337    if (f==l_abil)
    338338    {
    339       void *l=CDR(CAR(field));
     339      LObject *l = CDR(CAR(field));
    340340      PtrRef r4(l);
    341341      for (i=0; i<TOTAL_ABILITIES; i++)
    342342      {
    343     Cell *ab=assoc(LSymbol::FindOrCreate(ability_names[i]),l);
     343    Cell *ab = LSymbol::FindOrCreate(ability_names[i])->Assoc(l);
    344344    PtrRef r5(ab);
    345345    if (!NILP(ab))
     
    348348    } else if (f==l_funs)
    349349    {
    350       void *l=CDR(CAR(field));
     350      LObject *l = CDR(CAR(field));
    351351      PtrRef r4(l);
    352352      for (i=0; i<TOTAL_OFUNS; i++)
    353353      {
    354     Cell *ab=assoc(LSymbol::FindOrCreate(ofun_names[i]),l);
     354    Cell *ab = LSymbol::FindOrCreate(ofun_names[i])->Assoc(l);
    355355    PtrRef r5(ab);
    356356    if (!NILP(ab) && lcar(lcdr(ab)))
     
    359359    } else if (f==l_flags)
    360360    {
    361       void *l=CDR(CAR(field));
     361      LObject *l = CDR(CAR(field));
    362362      PtrRef r4(l);
    363363      for (i=0; i<TOTAL_CFLAGS; i++)
    364364      {
    365     Cell *ab=assoc(LSymbol::FindOrCreate(cflag_names[i]),l);
     365
     366    Cell *ab = LSymbol::FindOrCreate(cflag_names[i])->Assoc(l);
    366367    PtrRef r5(ab);
    367368    if (!NILP(ab) && lcar(lcdr(ab))->Eval())
     
    456457
    457458
    458   Cell *mrph=assoc(l_morph,desc);     // check for morph info
     459  Cell *mrph = l_morph->Assoc(desc);     // check for morph info
    459460  morph_power=0;
    460461  if (!NILP(mrph))
     
    465466  } else morph_mask=-1;
    466467
    467   Cell *sa=assoc(l_state_art,desc);
     468  Cell *sa = l_state_art->Assoc(desc);
    468469  if (NILP(sa))
    469470  {
     
    484485  }
    485486
    486   Cell *range=assoc(l_range,desc);
     487  Cell *range = l_range->Assoc(desc);
    487488  if (!NILP(range))
    488489  {
     
    498499
    499500
    500   Cell *mf=assoc(l_fields,desc);
     501  Cell *mf = l_fields->Assoc(desc);
    501502  if (!NILP(mf))
    502503  {
     
    512513      if (find<0)
    513514      {
    514     lprint(assoc(l_fields,desc));
     515    lprint(l_fields->Assoc(desc));
    515516    printf("fields : no such var name \"%s\"\n",name);
    516517    printf("current possiblities are : \n");
     
    529530
    530531
    531   Cell *lg=assoc(l_logo,desc);
     532  Cell *lg = l_logo->Assoc(desc);
    532533  if (NILP(lg))
    533534  {
Note: See TracChangeset for help on using the changeset viewer.