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: jason:cunliffe:verizon at: 5-May-2002 12:15

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"
>>> test[0]
>>> test[4]
>>> test[-1]
>>> test[-2]
'd' It works with ranges too [Python]
>>> test[1:3]
>>> test[0:-2]
'abc' REBOL
>> test: "abcde"
== "abcde"
>> test/5
== #"e"
>> test/-2
== none any ideas? ./Jason Note: Python uses zero indexing instead of REBOL's more natural common counting sense "1", also ":" is a 'range' separator