Changeset 538 for trunk/thune/eval.c
- Timestamp:
- 06/14/08 16:30:57 (6 months ago)
- Files:
-
- 1 modified
-
trunk/thune/eval.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/eval.c
r533 r538 1089 1089 (word -- val) 1090 1090 (word ctx -- val) 1091 /words (ctx -- blk) 1091 1092 */ 1092 1093 UR_CALL( uc_get ) … … 1107 1108 else if( ur_is(tos, UT_CONTEXT) ) 1108 1109 { 1109 val = ur_s_prev( tos ); 1110 if( ur_isAWord(val) ) 1111 { 1112 UBlock* blk; 1113 int wrdN; 1114 1115 wrdN = ur_lookup( tos, ur_atom(val) ); 1116 if( wrdN > -1 ) 1117 { 1118 blk = ur_blockPtr( tos->ctx.valBlk ); 1119 ur_copyCell(val, blk->ptr.cells[ wrdN ]); 1120 /* 1121 if( ur_is(ctx, UT_UNSET) ) 1122 _throwUnset( ut, ctx ); 1123 */ 1124 } 1125 else 1126 { 1127 ur_setNone( val ); 1128 } 1129 1130 UR_S_DROP; 1110 UBlock* blk; 1111 UCell* inv = UR_CALL_CELL; 1112 1113 if( inv && ur_sel(inv) == UR_ATOM_WORDS ) 1114 { 1115 int len; 1116 UIndex blkN; 1117 1118 blk = ur_blockPtr( tos->ctx.valBlk ); 1119 len = blk->used; 1120 blk = ur_blockPtr( tos->ctx.wordBlk ); 1121 val = blk->ptr.cells; 1122 1123 blkN = ur_makeBlockT( ut, len, &blk ); // gc! 1124 ur_copyCells( val, val + len, blk->ptr.cells ); 1125 blk->used = len; 1126 ur_bindT( ut, blkN, tos, isGlobalIndex(tos->ctx.valBlk) ? 1127 UR_BIND_GLOBAL : UR_BIND_THREAD ); 1128 1129 ur_initBlock( tos, blkN, 0 ); 1131 1130 return; 1131 } 1132 else 1133 { 1134 val = ur_s_prev( tos ); 1135 if( ur_isAWord(val) ) 1136 { 1137 int wrdN; 1138 1139 wrdN = ur_lookup( tos, ur_atom(val) ); 1140 if( wrdN > -1 ) 1141 { 1142 blk = ur_blockPtr( tos->ctx.valBlk ); 1143 ur_copyCell(val, blk->ptr.cells[ wrdN ]); 1144 /* 1145 if( ur_is(ctx, UT_UNSET) ) 1146 _throwUnset( ut, ctx ); 1147 */ 1148 } 1149 else 1150 { 1151 ur_setNone( val ); 1152 } 1153 1154 UR_S_DROP; 1155 return; 1156 } 1132 1157 } 1133 1158 } … … 1154 1179 #endif 1155 1180 1156 ur_throwErr( UR_ERR_DATATYPE, "get expected word! " );1181 ur_throwErr( UR_ERR_DATATYPE, "get expected word!/context!" ); 1157 1182 } 1158 1183
