Re: ? 1={}, is there really any other interpretation?
- Posted by Pete Lomax <petelomax at blueyond?r.co.?k> Jul 16, 2007
- 712 views
Andy Serpa wrote: > the answer is, of course, just to ADD NEW OPERATORS -- just add a colon (or > whatever) to each operator to make it a strict boolean operator: > > :< > := > :> > > etc. > > Problem solved. No code breaks, and you've got some nice shortcuts so you > never > have to type compare(). What's the problem with that? Some reasons why it should be @< to specify a sequence op rather than :< to specify an atomic op: 1) Over 99.95% of existing operator usage is atomic. 2) It should be possible for one deviation in parser.e to process new @-ops whereas :-ops would probably want to be interleaved? (Specifically I am thinking that UFactor could have the one test if tok[T_ID]>=SPLUS and tok[T_ID]<=SXOR then invoke a new parse chain of SExpr->Srexpr->Scexpr->Saexpr->Sterm->SUFactor->Factor else ->Factor as now, iyswim.) 3) :-ops add to rather than decrease (newbie) confusion. return name="pete" is the natural thing to type. replacing "use equal()" with "use :=" is less than helpful. Eg name@="pete" makes it clear I want lots of 1s and 0s. 4) ":=" looks very misleading to this particular ex-Pascal student. Rob: Perhaps instead of asking "should we kill off sequence ops", which I am not advocating, it is the IMPLICIT part that causes problems, the questions that should be asked (as well) are: Do we want short-circuiting in all expressions? This cannot be done as long as "and" & "or" are sequence-op-capable, but could be if "and" became atom-only and either "@and" or "sq_and()" created to replace that particular functionality, ditto "or". Do we want the 'if name="pete" then' gotcha to go away and instead for such expressions to work as humans expect? Do we want expressions to have the same meaning wherever they occur or behave different in if/while to assign/params? Regards, Pete ERROR: Your rant quota has been exceeded. To increase this limit call 555-407-6565.