Re: RFC: Breaking existing Euphoria functionality
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 22, 2007
- 606 views
Michael J. Sabal wrote: > > Has anybody written a statement like this: > > result = ({'a','b','c'} = {'a','b','f'}) > > and expected result to look like this: > > ? result > {1,1,0}? > > 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. The benefit to this change > would allow sequences to be compared in an if or while statement without > requiring compare or equal. The drawback is breaking existing functionality. > I expect the performance hit to be negligible. I don't see the need to do this though. The sequence operations are not a bad thing to have, generally speaking. My issue is that conditional statements should not be doing a sequence operation but a comparision operation instead. Thus ... if XYZ < ABC then should be viewed as a comparision and not a sequence operation. However ... DEF = (XYZ < ABC) should be a sequence operation (then an assignment) because it is not in the context of a conditional statement ('if', 'while' ...) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell