#284 "ordered_appendall" missing return statement

3.1.2
closed
Rick McGuire
Classes (182)
5
2012-08-14
2007-05-29
No

"ordered_appendall" misses a return statement and as such will always raise the syntax error 93.948.

There is a little patch file uploaded with this message which should fix the behaviour.

Program to demonstrate:

------------ cut here ------------
a1=.array~of(1,2,3)
a2=.array~of(4,5)
a3=a1~appendAll(a2)
------------ cut here ------------

Discussion

  • Rick McGuire
    Rick McGuire
    2007-05-29

    Logged In: YES
    user_id=1125291
    Originator: NO

    AppendAll is an in-place update to the object and does not have a return value.

     
  • Logged In: YES
    user_id=662126
    Originator: YES

    Yes, but that is not what I stated. The problem is indeed a missing "return" statement (please note: no argument). Therefore the code runs into the RAISE statement under all circumstances:

    -------------------- cut here ---------------------
    /******/
    /
    APPENDALL method
    /
    /
    ********/
    ::method ordered_appendall
    use strict arg other

    signal on nomethod

    do item over other~allItems / loop over the other collection /
    self~append(item) -- appending the item
    end

    nomethod:
    -- an unknown method is an argument problem. report it as such.
    raise syntax 93.948 array(1, "Collection")
    -------------------- cut here ---------------------

     
  • Rick McGuire
    Rick McGuire
    2007-05-29

    Logged In: YES
    user_id=1125291
    Originator: NO

    Oops, sorry....trying to do to many things at one time and skimmed over the description too quickly.

    Committed revision 410.

     


Anonymous


Cancel   Add attachments