Re: left, right? head, tail? which one?
- Posted by Kat <KAT12 at ?oo?ahs.net> Apr 25, 2008
- 729 views
> > }}} <eucode> > > sequence s > > s = "ABC" > > puts(1, s[1..30]) > > </eucode> {{{ > > > > That needs to err out, as it does. > > And I agree here. I don't. So s[4..30] don't exist, they just shouldn't be printed out. Otherwise, you haveto do:
if length(s) then -- so line 5 doesn't error if length(s) > 30 then puts(1,s[1..30] (5) else puts(1,s[1..length(s)] end if else puts(1,"") end if
And i vote for left/right, AND head/tail. Whichever is provided, i'll likely alias it to the word i prefer for that operation. Kat