Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: How to remove the last item of a serie ?

From: greggirwin:mindspring at: 5-May-2002 15:23

Hi Jason, << Python has a really nice tail syntax for ends of list, strings, tuples etc. There must be an easy way to do this as cleanly in REBOL... What do you all think about this essential idioms? [Python]
>>> test = "abcde"
'abcde'
>>> test[0]
'a'
>>> test[4]
'e'
>>> test[-1]
'e'
>>> test[-2]
'd' >> That syntax doesn't grab me as being very natural. It kind of makes it look like series! are circular as well, which they aren't. Anyway, in general I'm fine with TAIL, SKIP, and BACK. In this particular case, you could write a remove-tail function which would be even better. --Gregg