object replication

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

Below is a routine to copy any object "exactly". But my intent is really to
release the original object from any pointers. This will have speed
benefits. However I am not sure that a full image will be created and not be
simply a bunch of pointers. Can anyone help? Rob?

function seq(object x)
sequence result
if atom(x) then return x end if
if length(x) then
  result=repeat(0,length(x))
  for i= 1 to length(x) do
   result[i]=seq(x[i])
  end for
else return{}
end if
return result
end function

sequence any
}}

sequence other
other = seq(any)

? any
? other -- identical to 'any'

Yours truly
Michael Palffy
michael at igrin.co.nz

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

Search



Quick Links

User menu

Not signed in.

Misc Menu