From: "trans. (T. Onoma)" Date: 2004-10-06T05:43:20+09:00 Subject: Re: [RCR] New [] Semantics On Tuesday 05 October 2004 10:13 am, Markus wrote: > > r = 0<..<43 > > r = 0<..<=42 > > r = 0<=..<43 > > r = 0<=..<=42 > > > > r = 0<..+<42 > > r = 0<..+<=42 > > r = 0<=..+<42 > > r = 0<=..+<=42 > > I'm not sure what distinction you are making here with the '+'. length > > Basically tie-fighter ranges ( and x-wing ranges ;) F'ugly! :( Alhtough > > I like your direction. > > The core idea is actually peripheral to this (or visa versa); I'm > modifying parse.y to extend the idea of tOP_ASGN ( +=, -=, etc.) to > include (as user redefinable methods like <=> is presently) _all_ > combinations of operator characters. That's cool. Does it complexify or simplify the parser? > > Alternative is just to use standard-like notation: > > > > 0 < r < 43 > > 0 < r <= 42 > > 0 <= r < 43 > > 0 <= r <= 42 > > > > 0 < r +< 43 > > 0 < r +<= 42 > > 0 <= r +< 43 > > 0 <= r +<= 42 > > > > Who said assignment always had to be 'r =' ? Of course it would be nice > > if we could just do like: > > Yikes! I don't think that would be easy to parse at all, > especially since all three non-terminals could be syntactical complex. > And what if you wanted to pass a range as an actual parameter? Good point. > > r = :(0,43) > > r = :(0,42] > > r = :[0,43) > > r = :[0,42] > > > > r = :(0:43) > > r = :(0:42] > > r = :[0:43) > > r = :[0:42] > > Hmmm. That would be a little harder--or at least, I don't quite > see how to bend the parser to handle it. They should parse as symbols. I recall reading that symbol notation will be made more flexible in the future so quotes don't always have to be used for odd cases. But I'm certainly reaching here. This seems better: r = 10..43.0 r = 10..42 r = 10..43.0 r = 10..42 r = 10++33.0 r = 10++32 r = 10++33.0 r = 10++32 Where floats are exclusive and integers are inclusive. T.