Changeset 530


Ignore:
Timestamp:
02/04/09 22:49:43 (3 years ago)
Author:
mooneer
Message:

Integrate array class as System.collections.array (credit: Michael J. Edgar), and fixed tests and other issues resulting from the System.list patch.

Location:
interpreter/trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • interpreter/trunk/ChangeLog

    r523 r530  
     12/4/2009: 
     2    * list|append and operator+ now create new lists instead of modifying the existing list. 
     3      The << operator modifies the list on the left hand side. (credit: Michael J. Edgar) 
     4    * Integrate array class as System.collections.array. (credit: Michael J. Edgar) 
     5     
    161/31/2009: 
    27    * Regular expressions can be specified with "r/.../[i]" syntax (ticket #79) 
  • interpreter/trunk/modules/Makefile.am

    r528 r530  
    1313        __internal/_cinvoke_function.c __internal/_cinvoke_structure.c \ 
    1414        __internal/_cinvoke_callback.c System/digest.c System/digest/md5.c \ 
    15         System/digest/md5.h System/date/hires.c 
     15        System/digest/md5.h System/date/hires.c System/collections/array.c 
    1616 
    1717nobase_dist_pkglib_SCRIPTS = System.kt System/network/wrapper.kt \ 
  • interpreter/trunk/modules/System/list.c

    r529 r530  
    619619    kite_add_operator(thread, newclass, OP_ADD,  
    620620        kite_new_method_compiled_with_docs(thread, List_add,  
     621        "Creates a new list that is the combination of the two operands.", 1, 
     622        "item", "Item to add.")); 
     623 
    621624   kite_add_operator(thread, newclass, OP_LEFT_SHIFT,  
    622625       kite_new_method_compiled_with_docs(thread, List_lshift,  
     
    624627                                 "item", "Item to add.")); 
    625628                                  
    626                                   "Creates a new list that is the combination of the two operands.", 1, 
    627                                   "item", "Item to add.")); 
    628629    kite_add_operator(thread, newclass, OP_LESS_THAN,  
    629630        kite_new_method_compiled_with_docs(thread, List_lessthan,  
  • interpreter/trunk/modules/System/regex.kt

    r520 r530  
    173173    while(not (thematch is System.null) and j < max) 
    174174    [ 
    175         ret|append(str|substring(start, thematch.match_begin - start)); 
     175        ret << str|substring(start, thematch.match_begin - start); 
    176176        decide 
    177177        [ 
     
    180180                while(i < thematch.captures|count) 
    181181                [ 
    182                     ret|append(thematch.captures[i]); 
     182                    ret << thematch.captures[i]; 
    183183                    i = i + 1; 
    184184                ]; 
     
    191191    ]; 
    192192     
    193     ret|append(str|substring(start)); 
     193    ret << str|substring(start); 
    194194    ret; 
    195195]; 
     
    214214        while (i < arg|get_num_groups) 
    215215        [ 
    216             this.captures|append(arg|get_group(i)); 
     216            this.captures << arg|get_group(i); 
    217217            i = i + 1; 
    218218        ]; 
  • interpreter/trunk/tests/Makefile.am

    r523 r530  
    248248./objs/os/args.kt.out \ 
    249249./objs/os/args.kt \ 
     250./objs/array/test_array.kt \ 
     251./objs/array/test_array.kt.out \ 
    250252./objs/regex/basic_regex.kt \ 
    251253./objs/regex/basic_regex.kt.out \ 
  • interpreter/trunk/tests/objs/list/append.kt.out

    r199 r530  
    11[2] 
    2 [[1, 2, 3]] 
     2[1, 2, 3] 
    33[1, 2, 3] 
    44[1, 2, 3, 4] 
  • interpreter/trunk/tests/objs/list/prepend2.kt

    r247 r530  
    11stack = []; 
    2 stack|append("is a"); 
    3 stack|prepend("This "); 
    4 stack|append(" test!"); 
     2stack = stack|append("is a"); 
     3stack = stack|prepend("This "); 
     4stack = stack|append(" test!"); 
    55stack|print; 
Note: See TracChangeset for help on using the changeset viewer.