Re: Euphoria 2.5

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

cklester wrote:
> I admit I've never really fretted over using s[length(s)]

And neither have I. Its the much more commonly used ...

   if A_Very_Long_But_Meaningful_Identifier_Name[
     length(A_Very_Long_But_Meaningful_Identifier_Name)] = '\n' then
       A_Very_Long_But_Meaningful_Identifier_Name = 
          A_Very_Long_But_Meaningful_Identifier_Name[ 1 ..
            length(A_Very_Long_But_Meaningful_Identifier_Name)- 1]
   end if

that I have high hopes for.

   if A_Very_Long_But_Meaningful_Identifier_Name[$] = '\n' then
       A_Very_Long_But_Meaningful_Identifier_Name = 
          A_Very_Long_But_Meaningful_Identifier_Name[ 1 .. $-1]
   end if

It saves not only typing, but more importantly, the reading!

I have over 100 uses of length() inside slice expressions in Win32lib,
so anything that helps me maintain this is welcome.

-- 
Derek Parnell
Melbourne, Australia

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

Search



Quick Links

User menu

Not signed in.

Misc Menu