From: Markus Date: 2004-10-05T23:13:37+09:00 Subject: Re: [RCR] New [] Semantics On Tue, 2004-10-05 at 01:33, trans. (T. Onoma) wrote: > Hmm... a bit of a touch up (btw unbound can be represented by it's own object, > so no special syntax required): If there is no special syntax, but how do create them? I'll admit I like the idea of Infinity posted on the next thread over, but that came up after I started. > 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 '+'. > 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. > 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? > 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. -- Markus