Re: left, right? head, tail? which one?

new topic     » goto parent     » topic index » view thread      » older message » newer message

> > }}}
<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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu