[CSCI2322] Re: homework 3 help

John Howland jhowland at ariel.cs.trinity.edu
Wed Sep 20 10:30:43 CDT 2006


On Tue, 19 Sep 2006, Horn, Britton wrote:

>
> Dr. Howland,
>
> I was having some trouble with homework 3. I can't figure out how to make it into a dyad. I tried using append and compose but those don't work (at least not where I used them). If there is a place where I could go on the internet to find help that would be great. This is the most I've gotten for a function, but I get a length error if I use it:

Britton,

The question seems (to me) to be "What should the arguments be of the new_compress function?"

The answer I would give is that the right argument should be the same
as that of compress and the left argument should be a list of items
(notice I didn't say characters -- think in more general terms) which,
if next to each other, should be treated as adjacent separators which
are to be compressed to a single separator.  For example:

' ' new_compress 'hi   there' ==> 'hi there' just as compress does, but
(' ',9{a.) new_compress text  should treat both space and tab as separator items and:

1 2 new_compress 3 1 1 4 5 1 2 9 10 ==> 3 1 4 5 1 9 10
1 2 new_compress 3 1 1 4 5 2 1 9 10 ==> 3 1 4 5 2 9 10

Your question is good, so I'm copying our class discussion list
also.

John

>

[lines deleted]

>
> Any help would be greatly appreciated,
>
> Britton Horn
>

_______________________________________________________________
John E. Howland       url: http://www.cs.trinity.edu/~jhowland/
Computer Science    email: jhowland at ariel.cs.trinity.edu
Trinity University  voice: (210) 999-7364
One Trinity Place     fax: (210) 999-7477
San Antonio, Texas  78212-7200


More information about the CSCI2322 mailing list