forum-msg-id-127029-edit

Original date:2015-02-16 09:14:35 Edited by: irv Subject: Re: feature req: passing sequences

cargoan said...

object junk = get_position() 
position(junk[1],junk[2]) -- this works 
position(junk)            -- this crashes 

override procedure position(object row, integer column = 1) 
   if sequence(row) then 
      if length(row) > 1 then 
            column = row[2] 
      end if 
      row = row[1] 
   end if 
   eu:position(row, column) 
end procedure 

It's not that we don't know how to patch this, the question is, shouldn't Euphoria routines be as logical as possible? IOW, if if returns a sequence, it accepts a sequence.

When there is a difference between what you recieve and what you send, it just means one more thing to trip up newcomers, and one more thing for the rest of us to remember or look up. And one more thing to document.

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu