Re: Re[2]: (Another) (small) Eu 2.5 feature request.
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Sep 24, 2004
- 463 views
On Thu, 23 Sep 2004 15:29:40 -0700, Derek Parnell <guest at RapidEuphoria.com> wrote: > unknown wrote: (but I also reply to Derek below) > > better use another syntax? Trust me on this one... The dot notation, if adopted, *MUST* be a simple shorthand for an immediate subscript. (Highest possible precedence or whatever). Eg x.1+3 *Must* be x[1]+3 NOT x[1+3] Before you proclaim that wrong, think about: x.balance+300 I care not about eg x.y.z, though would recommend it is always x[y][z] rather than always x[y[z]] (basic left or right associativity either way). You should not consider using this sort of shorthand for slices, don't be silly. <back to Derek's comments:> >And slower. > <snip> Do you mean slower than eg Constant PersonalName=1, FamilyName=2, ... type customer(sequence s) if length(s)!=5 then return 0 end if if not sequence(s[PersonalName]) then return 0 end if ... end type >In which case, the interpreter would need to add extra checks to >append(), prepend(), &, slicing and assignment to make sure it was >not changing the target's length, or datatypes. Hmmm. You got me thinking about ways to make some of that illegal in the eyes of the compiler... I'm now thinking that CurrentCust&=<blah> is just a fatal non-compilable meaningless statement. I am also considering that while CurrentCust.PersonalName = "Derek" is obviously valid, CCList=sequence of customer (If only we had "sequence of customer", ....) CCList[i].PersonalName = "Derek" might not be valid/supported for a few versions to come, if it makes things easier?? Not quite sure why I see that as critical, I suspect it is a combination of the difficulty of implementig"sequence of"and the scope problems of PersonalName, unless it can *only* be used as a short immediate subscript on a customer var, which makes sense to me.. Whatever, I for one would certainly not attempt all of this in one hit, related as it is or not! It is far from easy to see how best to do it. Regards, Pete