Changeset 341

Show
Ignore:
Timestamp:
01/07/07 16:56:56 (2 years ago)
Author:
krobillard
Message:

Fixed 'at (thanks to Krzysztof Kowalczyk)
Thune - Added 'appen helper. [0 random] no longer crashes.

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/series.c

    r144 r341  
    11171117        else    // OT_DECIMAL 
    11181118            n = ((int) orDecimal(a2)); 
    1119         if( n == 1 ) 
    1120             n = 0; 
     1119        if( n > 0 ) 
     1120            --n; 
    11211121    } 
    11221122 
  • trunk/thune/boot.c

    r323 r341  
    172172  "[0 swap add] proc :to-dec\n" 
    173173  "[rot minimum maximum] proc :limit   ; (n min max -- n)\n" 
     174  "[append drop] proc :appen\n" 
    174175  "[blk | ctx num word]\n" 
    175176  "[\n" 
  • trunk/thune/doc/UserManual

    r337 r341  
    385385==========  ======================  ================= 
    386386empty?      (ser -- logic)          Same as tail?. 
     387appen       (ser val -- )           Append and drop. 
    387388map         (ser comb -- )          Transform each element of a series. 
    388389split-path  (full -- path file)     Split full path into path & file. 
  • trunk/thune/math.c

    r336 r341  
    541541    else if( ur_is(tos, UT_INT) ) 
    542542    { 
    543         ur_int(tos) = (genrand_int32() % ur_int(tos)) + 1; 
     543        if( ur_int(tos) > 0 ) 
     544            ur_int(tos) = (genrand_int32() % ur_int(tos)) + 1; 
    544545    } 
    545546    else if( ur_isASeries( tos ) ) 
  • trunk/thune/mkboot.t

    r323 r341  
    199199[rot minimum maximum] proc :limit   ; (n min max -- n) 
    200200 
     201[append drop] proc :appen 
     202 
    201203[blk | ctx num word] 
    202204[ 
  • trunk/thune/series.c

    r337 r341  
    18471847        else    // UT_DECIMAL 
    18481848            n = (int) ur_decimal(tos); 
    1849         if( n == 1 ) 
    1850             n = 0; 
     1849        if( n > 0 ) 
     1850            --n; 
    18511851    } 
    18521852