Gregg et al

I think that it would be most in keeping with the "Rebol way" if there were
two new refinements for REMOVE - REMOVE/BEFORE & REMOVE/AFTER. I think they
are relatively self-explanatory and they would be very readable:

remove/before mystring find mystring "Peter"
remove/after mystring find mystring "Wood"

Of course it would be great if the before and after refinements included an
implicit find so that you could code :

remove/before mystring "Peter"
remove/after mystring "Wood"

Is there anyway to add refinements to existing Rebol functions as mezzanine
code?

Regards

Peter

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Gregg Irwin
Sent: 15 December 2004 01:41
To: PeterWAWood
Subject: [REBOL] Re: Best way to remove the last character from a string?


Peter et al,

P> I've worked out two ways to chop-off the last character of a string.
...
P> Can anyone suggest a less verbose, clearer and quicker way for me?
 
This is a great topic for general discussion of a CHOP mezzanine!

I'm sure a lot of us have them, and different ones for different uses.
If we can come up with a good one, then we can propose it to RT for
inclusion in REBOL. The trick is that it must be a good, flexible function
(IMO).

Thoughts:

    Chop n items from head, tail, or both (default: tail)?

    Chop at an arbitrary position in the series, or just use
    AT when you make the call?

    n can be a number other than one, but default behavior
    is to chop one item?

    Should the series be copied, or altered in place?

    Return the item(s) removed, or should that be a different
    function (PULL, CUT)?


-- Gregg                         

--
To unsubscribe from the list, just send an email to rebol-request at
rebol.com with unsubscribe as the subject.



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.813 / Virus Database: 553 - Release Date: 13/12/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.813 / Virus Database: 553 - Release Date: 13/12/2004
 

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to