Re: The fate of Euphoria=20
- Posted by Tone Škoda <tskoda at email.si> Nov 11, 2004
- 412 views
Patrick Barnes wrote: > > On Wed, 10 Nov 2004 13:02:50 -0800, Tone =C5=A0koda <guest at > rapideuphoria.co= > m> wrote: > > posted by: Tone =C5=A0koda <tskoda at email.si> > > > > Patrick Barnes wrote: > > > > > The features that I feel Euphoria is 'missing' are > > > better flow control - continue, continue and exit with specified level. > > > > I don't find these so neccessary. > > That's alright, perhaps there is something you feel would be nice to > have in Euphoria, but I am rather ambivalent about. > > > > the ability to give sequences a rigid structure when it's needed. > > > > There should be something done about this, but I don't have a good sugges= > tion what.=20 > > Maybe it's best if it stays as it is, using types. > > Well, that's what the 'of' specification is. An enhancement to the > types system that makes them much faster, and more capable. with type_check is sometimes really very slow. I don't know why. I have EXTRA_DEBUG variable, and then i do this: if EXTRA_DEBUG then > > > I use "structures" a lot, in fact all data is saved in structured sequenc= > es. > > Me too. In fact, no code I have ever seen has a large sequence in the > program that is *NOT* structured. > > > > Did you see the document I sent to the list back in June about the > > > 'of' statement? It would make structures possible and type checking > > > much, much faster (As tests have proved) > > > <a href="http://users.secsme.org.au/~prbarnes/misc/oth/type_of.txt">h= > ttp://users.secsme.org.au/~prbarnes/misc/oth/type_of.txt</a> > > > > At first look it looks a bit complicated. > > Well, I'm not the *best* technical writer. However, it's rather > in-depth because it contains all data necessary to implement the idea, > look here: <a > href="http://users.secsme.org.au/~prbarnes/misc/oth/of.zip">http://users.secsme.org.au/~prbarnes/misc/oth/of.zip</a> > > For the programmer using it, it's very simple... Contrived example: > > Old type: > type int_array( object x ) > if sequence(x) then > for a = 1 to length(x) do > if not integer(x[a]) then > return 0 > end if > end for > return 1 > end if > return 0 > end type > > New type: > type int_array( sequence of integer x) > return 1 > end type > > }}} <eucode> > int_array test_array > test_array = {} > for a = 1 to 100 do > test_array &= rand(100) --Add an integer to the end of test_array > end for > test_array &= 1.05 --The program will crash here, due to a type_check f= > ailure. > </eucode> {{{ > > The advantage over implementing a traditional 'type' that does the > same thing, is that to get through the for-loop above, the traditional > type has to check 5500 (1+2+3+4...+10) elements, whereas the new 'of' > type only has to check 100. > > If speed was sorely needed for a tight loop, then perhaps a > type_check([0|1]) function could be added, to turn type checking on > and off dynamically. > > -- > MrTrick > ---------- > >