in reply to a farewell to chop

So far, a brief look through stuff here at work, I've counted 43 occurences of chop(). I think we'll miss it a bit.

I'd be happy if they would simply rename chop(). That way we solve the problems of confusing beginners, but keep the functionality that seems to be useful to some of us. Maybe it could be renamed cut() at the risk of confusing any shell scripters out there.

cephas

Replies are listed 'Best First'.
Re: Re: a farewell to chop
by John M. Dlugosz (Monsignor) on Sep 11, 2002 at 18:34 UTC
    I like truncate, and it could work for arrays and strings. Hmm, isn't that what pop does for an array? Just allow pop to work on a string, too.

Re^2: a farewell to chop
by Aristotle (Chancellor) on Sep 11, 2002 at 17:11 UTC
    How about calling it hack? :-)

    Makeshifts last the longest.

Re: Re: a farewell to chop
by jryan (Vicar) on Sep 11, 2002 at 17:36 UTC
    Ah, but there is already a perl6 regular expression assertion named <cut>, which does something different. Having a prefix and an assertion that are named the same yet do different things would lead to even more confusion. Perhaps trim()?
      Trim() has a well-understood meaning in other languages and I think it would be a misleading to redefine it for Perl. How about scalp()?

      --
      May the Source be with you.

      You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

      What Solo said.. or maybe bite? Or nibble? :-)

      Makeshifts last the longest.