Changeset 538
- Timestamp:
- 06/14/08 16:30:57 (4 months ago)
- Location:
- trunk/thune
- Files:
-
- 7 modified
-
doc/UserManual (modified) (2 diffs)
-
eval.c (modified) (3 diffs)
-
gl/gx_atoms.h (modified) (1 diff)
-
gl/project.r (modified) (1 diff)
-
internal.h (modified) (1 diff)
-
urlan.c (modified) (4 diffs)
-
urlan_atoms.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/doc/UserManual
r534 r538 421 421 get (word -- val) Retrieve value referenced by word. 422 422 get (word ctx -- val) Retrieve value from context. 423 get/words (ctx -- block) Make a block of the context's words. 423 424 bind (block ctx -- block) Bind block to context. 424 425 infuse (block ctx -- block) Replace words with context values. … … 585 586 to-dec (int -- int) Flag integer to display in decimal. 586 587 checksum (bin type -- digest) Compute 'crc16 or 'sha1 checksum. 588 change-dir (dir -- logic) Change working directory. 589 what-dir ( -- path) Get working directory. 590 make-dir (dir-name -- ) Make filesystem directory. 591 file-info (filename -- block) Get file information. 592 now ( -- time) Get current time. 587 593 =========== ====================== ====================== 588 594 -
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 -
trunk/thune/gl/gx_atoms.h
r535 r538 1 1 // This file is automatically generated - do not edit. 2 2 3 #define UR_ATOM_DRAW_LIST_OPCODES 3 294 #define UR_ATOM_WIDTH 3 305 #define UR_ATOM_HEIGHT 3 316 #define UR_ATOM_AREA 3 327 #define UR_ATOM_RECT 3 338 #define UR_ATOM_SIZE 3 349 #define UR_ATOM_RASTER 3 3510 #define UR_ATOM_TEXTURE 3 3611 #define UR_ATOM_ELEM 3 3712 #define UR_ATOM_CLOSE 1 8813 #define UR_ATOM_FOCUS 3 3814 #define UR_ATOM_RESIZE 3 3915 #define UR_ATOM_KEY_DOWN 3 4016 #define UR_ATOM_KEY_UP 3 4117 #define UR_ATOM_MOUSE_MOVE 3 4218 #define UR_ATOM_MOUSE_UP 3 4319 #define UR_ATOM_MOUSE_DOWN 3 4420 #define UR_ATOM_MOUSE_WHEEL 3 4521 #define UR_ATOM_AMBIENT 3 4622 #define UR_ATOM_DIFFUSE 3 4723 #define UR_ATOM_SPECULAR 3 4824 #define UR_ATOM_POS 3 4925 #define UR_ATOM_SHADER 3 5026 #define UR_ATOM_VERTEX 3 5127 #define UR_ATOM_FRAGMENT 3 5228 #define UR_ATOM_DEFAULT 3 5329 #define UR_ATOM_WAIT 1 3830 #define UR_ATOM_LEFT 3 5431 #define UR_ATOM_RIGHT 3 5532 #define UR_ATOM_CENTER 3 5633 #define UR_ATOM_RGB 3 5734 #define UR_ATOM_RGBA 3 5835 #define UR_ATOM_DEPTH 3 5936 #define UR_ATOM_CLAMP 3 6037 #define UR_ATOM_REPEAT 3 6138 #define UR_ATOM_NEAREST 3 6239 #define UR_ATOM_LINEAR 3 6340 #define UR_ATOM_MIN 3 6441 #define UR_ATOM_MAG 3 6542 #define UR_ATOM_MIPMAP 3 6643 #define UR_ATOM_GRAY 3 6744 #define UR_ATOM_RGB 3 5745 #define UR_ATOM_RGBA 3 5846 #define UR_ATOM_ON 2 7247 #define UR_ATOM_OFF 2 7448 #define UR_ATOM_ADD 2 0749 #define UR_ATOM_BURN 3 6850 #define UR_ATOM_COLOR 3 6951 #define UR_ATOM_TRANS 3 7052 #define UR_ATOM_SPRITE 3 7153 #define UR_ATOM_ONCE 3 7254 #define UR_ATOM_PING_PONG 3 7355 #define UR_ATOM_PONG 3 743 #define UR_ATOM_DRAW_LIST_OPCODES 339 4 #define UR_ATOM_WIDTH 340 5 #define UR_ATOM_HEIGHT 341 6 #define UR_ATOM_AREA 342 7 #define UR_ATOM_RECT 343 8 #define UR_ATOM_SIZE 344 9 #define UR_ATOM_RASTER 345 10 #define UR_ATOM_TEXTURE 346 11 #define UR_ATOM_ELEM 347 12 #define UR_ATOM_CLOSE 199 13 #define UR_ATOM_FOCUS 348 14 #define UR_ATOM_RESIZE 349 15 #define UR_ATOM_KEY_DOWN 350 16 #define UR_ATOM_KEY_UP 351 17 #define UR_ATOM_MOUSE_MOVE 352 18 #define UR_ATOM_MOUSE_UP 353 19 #define UR_ATOM_MOUSE_DOWN 354 20 #define UR_ATOM_MOUSE_WHEEL 355 21 #define UR_ATOM_AMBIENT 356 22 #define UR_ATOM_DIFFUSE 357 23 #define UR_ATOM_SPECULAR 358 24 #define UR_ATOM_POS 359 25 #define UR_ATOM_SHADER 360 26 #define UR_ATOM_VERTEX 361 27 #define UR_ATOM_FRAGMENT 362 28 #define UR_ATOM_DEFAULT 363 29 #define UR_ATOM_WAIT 149 30 #define UR_ATOM_LEFT 364 31 #define UR_ATOM_RIGHT 365 32 #define UR_ATOM_CENTER 366 33 #define UR_ATOM_RGB 367 34 #define UR_ATOM_RGBA 368 35 #define UR_ATOM_DEPTH 369 36 #define UR_ATOM_CLAMP 370 37 #define UR_ATOM_REPEAT 371 38 #define UR_ATOM_NEAREST 372 39 #define UR_ATOM_LINEAR 373 40 #define UR_ATOM_MIN 374 41 #define UR_ATOM_MAG 375 42 #define UR_ATOM_MIPMAP 376 43 #define UR_ATOM_GRAY 377 44 #define UR_ATOM_RGB 367 45 #define UR_ATOM_RGBA 368 46 #define UR_ATOM_ON 283 47 #define UR_ATOM_OFF 285 48 #define UR_ATOM_ADD 218 49 #define UR_ATOM_BURN 378 50 #define UR_ATOM_COLOR 379 51 #define UR_ATOM_TRANS 380 52 #define UR_ATOM_SPRITE 381 53 #define UR_ATOM_ONCE 382 54 #define UR_ATOM_PING_PONG 383 55 #define UR_ATOM_PONG 384 -
trunk/thune/gl/project.r
r527 r538 83 83 cflags {-DLANG_THUNE -DTHUNE_GL} 84 84 include_from %. 85 include_from %.. 85 86 libs_from %. %thune-gl0 86 87 libs_from %.. %thune0 -
trunk/thune/internal.h
r516 r538 16 16 #define BLK_CTX_STACK 3 17 17 //#define BLK_DSTACK 4 18 19 20 #define isGlobalIndex(n) (n < 0) 18 21 19 22 -
trunk/thune/urlan.c
r511 r538 308 308 FIXED_ATOM( "case", 4, UR_ATOM_CASE ) 309 309 FIXED_ATOM( "reader-macros", 13, UR_ATOM_READER_MACROS ) 310 FIXED_ATOM( "words", 5, UR_ATOM_WORDS ) 311 //FIXED_ATOM( "key-values", 10, UR_ATOM_KEY_VALUES ) 312 313 // ^^ Add new fixed atoms here ^^ 314 // Reduce ATOMS_RESERVED for each new FIXED_ATOM to keep the number of 315 // atoms constant. When it drops below zero then it should be reset to 316 // 10 and all library users who have their own fixed atoms must recompile. 317 318 #define ATOMS_RESERVED 10 319 { 320 static char resFixed[13] = "_res-fixed-0"; 321 int i; 322 for( i = 0; i < ATOMS_RESERVED; ++i ) 323 { 324 resFixed[11] = i + '0'; 325 ur_intern( resFixed, 12 ); 326 } 327 } 310 328 311 329 #if MAKE_ATOM_HEADER … … 826 844 UBlock* ur_blockPtrT( UThread* ut, UIndex n) 827 845 { 828 if( n < 0)846 if( isGlobalIndex(n) ) 829 847 return (((UBlock*) ut->env->blocks.arr.ptr.v) - n); 830 848 return (((UBlock*) ut->blocks.arr.ptr.v) + n); … … 834 852 UArray* ur_binPtrT( UThread* ut, UIndex n ) 835 853 { 836 if( n < 0)854 if( isGlobalIndex(n) ) 837 855 return (((UArray*) ut->env->bin.arr.ptr.v) - n); 838 856 return (((UArray*) ut->bin.arr.ptr.v) + n); … … 842 860 UResource* ur_resPtrT( UThread* ut, UIndex n ) 843 861 { 844 if( n < 0)862 if( isGlobalIndex(n) ) 845 863 return (((UResource*) ut->env->resources.arr.ptr.v) - n); 846 864 return (((UResource*) ut->resources.arr.ptr.v) + n); -
trunk/thune/urlan_atoms.h
r511 r538 49 49 #define UR_ATOM_CASE 112 50 50 #define UR_ATOM_READER_MACROS 113 51 #define UR_ATOM_WORDS 114
