Yuval~ On 9/20/05, Yuval Kogman <[EMAIL PROTECTED]> wrote: > Today on #perl6 I complained about the fact that this is always > inelegant: > > if ($condition) { pre } > > unconditional midsection; > > if ($condition) { post } > > I asked for some ideas and together with Aankhen we converged on the > following syntax: > > if ($condition) { > pre; > } uncond { > middle; > } cond { > post; > } > > s/uncond/<<pause regardless>>.pick/e; > s/cond/<<resume again>>.pick/e; > > Some restrictions: > > The block structure must always be ternary - for other cases we > already have enough control flow. > > The if is not the same if that can cuddle with else - it's either > or. > > Does anybody have any comments, or synonyms for the control > structure naming? > > BTW, I expect readability to be optimal with 1-2 lines of pre/post, > and 1-5 lines of middle. Any observations?
I don't really find this that inellegant. It also seems like something that is not painful enough to warrant adding new syntax, especially a syntax that conflicts with if .. else .. It seems like add complexity for very little win (granted it is not a lot of added complexity, but perl6 is already an very large language). Matt -- "Computer Science is merely the post-Turing Decline of Formal Systems Theory." -Stan Kelly-Bootle, The Devil's DP Dictionary