Changeset 179 for trunk/thune/eval.c

Show
Ignore:
Timestamp:
06/10/06 02:17:23 (3 years ago)
Author:
krobillard
Message:

Thune - Added 'either.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/eval.c

    r178 r179  
    377377        // default: leave tos unchanged... 
    378378    } 
     379} 
     380 
     381 
     382// (val do-true do-false -- ) 
     383UR_CALL( uc_either ) 
     384{ 
     385    UCell* res = ur_s_backN(tos, 2); 
     386 
     387    if( ur_is(res, UT_NONE) || 
     388        (ur_is(res, UT_LOGIC) && ! ur_logic(res)) ) 
     389    { 
     390        ur_copyCell( res, *tos ); 
     391    } 
     392    else 
     393    { 
     394        ur_copyCell( res, *(ur_s_prev(tos)) ); 
     395    } 
     396 
     397    UR_S_DROPN(2); 
     398    uc_do( ur_thread, res ); 
    379399} 
    380400 
     
    21192139    { uc_typeQ,        "type?" }, 
    21202140    { uc_typeQ_word,   "type?.word" }, 
     2141    { uc_either,       "either" }, 
    21212142    { uc_to_text,      "to-text" }, 
    21222143    { uc_console_out,  "console.out" },