[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sample program



Bay sent me the following program to reverse a string of characters:

_AddSlotsIfAbsent: ( | danny = () | )

danny _Define: ( |
    parent* = traits oddball.

    reverse: str = ( | rev <- '' |
        str do: [ | :c | rev: c, rev ].
        rev ).
| )

I did the _RunScript on this file and it went fine. However, when I type in
" reverse: 'backwards' " I received this message not understood error:

Message not understood
        Message type: ImplicitSelf
        Receiver: <4>: lobby
        Selector: reverse:
        Arguments: vector{'backwards'}
        MethodHolder: <4>: lobby

Can you tell what I am doing wrong? Also, I am having trouble using the
list-specific selectors for collections. Do I need to define the objects
in a special way for these selectors? I do not seem to be having any trouble
with the other selectors.
Thanks,
Danny Travis
danny@cs4sun.cs.ttu.edu