Re: feature req: passing sequences

new topic     » goto parent     » topic index » view thread      » older message » newer message
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 receive 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.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu