Re: Better Way to Do This

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...

Is there a standard lib or more efficient function that could replace this? I'm using this for a type definition. The variable needs to be all sequences.

function no_atoms( sequence s ) 
integer i = 1 
	for t=1 to length(s) do 
		if atom(i) then return 0 end if 
	end for 
	return 1 
end function 

Would this be faster ?

function no_atoms( sequence s ) 
integer i = length(s) 
while(sequence(s[i]) and i > 0 ) do 
  i -= 1 
end while 
if i = 0 then return 1 else return 0 end if 
end function 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu