Re: Euphoria 2.5 Features..... ??
- Posted by "Lucius L. Hilley III" <L3Euphoria at bellsouth.net> Dec 13, 2003
- 501 views
----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: <EUforum at topica.com> Subject: Re: Euphoria 2.5 Features..... ?? <SNIP by Unkmar> > sequence of integer Scores > > which would cause Euphoria to ensure that only integers were stored in the sequence. <SNIP by Unkmar> > Derek > global type seq_of_int(object x) sequence mask if atom(x) then return 0 -- an atom isn't a sequence else mask = repeat(0, length(x)) if compare(mask, (x*0) then return 0 -- a sequence must be embedded. elsif compare(x, floor(x)) then return 0 -- a float is somewhere in the sequence else mask = (-1073741824 > x) or (x > 1073741823) return find(1, x) -- if 1 is found then outsite integer range end if end if end type Lucius L. Hilley III - Unkmar PS: This doesn't mean I am against a built in system. In fact. I'm for one. I don't like the above becuse it has a horrible speed penalty.