Re: Better Way to Do This
- Posted by bernie Aug 06, 2009
- 1145 views
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