Re: RFC: Breaking existing Euphoria functionality
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 22, 2007
- 580 views
Michael J. Sabal wrote: > Is there any code in the archives or recent user contributions (say less > than 3 years old) that takes advantage of this functionality? > > I would like to change binary_ops() in be_runtime.c so that the result of > comparing two sequences with an operator (=,<,>,<=,>=,!=) returns a single > boolean rather than a sequence of booleans. I have previously analysed this in detail for a few programs: win32lib contains some 18 instances of sequence ops (out of 45,000 lines of code), 3 of which are relational ops. arwen contains some 6 instances of sequence ops (out of 12,000 lines of code), 0 of which are relational ops. Edita contains some 11 instances of sequence ops (out of 30,000 lines of code), 0 of which are relational ops. wildcard.e, routines upper() and lower(), uses relational sequence ops. Hence I can claim with some authority that sequence ops are used on average less than once per 2000 lines of code, relational ops even less so. Obviously it is a trivial matter to "fix" these once you know where they are (I can supply detailed instructions on request, along with a set of replacement functions). I would strongly recommend changing the compiler to recognise such sequence ops and issue errors, if you or anyone else want to make such a change. I will add that is not possible in many cases, eg in upper()/lower() they act on objects, whereas eg rect[1..2]+=rect[3..4] is clearly detectable. Regards, Pete