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

Just thought of this one:

function cut(sequence s,sequence index)
   object x
   x=s
   for i=1 to length(x) do
      if sequence(index[i]) then
         x=x[index[i][1]..index[i][2]]
      else
         x=x[index[i]]
      end if
   end for
   return x
end function

This expands on standard Euphoria by allowing slices in any dimension, not
just the last.  Offhand, I don't know where I'd use this, but I'm sure
someone will find it useful.

-- Mike Nelson

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

Search



Quick Links

User menu

Not signed in.

Misc Menu