The increasing complexity of the rules does not persuade. ----------------------------------------------------------------------- |\/| Randy A MacDonald | you can't pay for it, |/\| [EMAIL PROTECTED] | even if you want to. BSc(Math) UNBF'83 Sapere Aude | APL: If you can say it, it's done.. Natural Born APL'er | Demo website: http://142.166.105.166/ ----------------------------------------------------(INTP)----{ gnat }-
----- Original Message ----- From: "p j" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Wednesday, March 22, 2006 11:43 AM Subject: Re: [Jprogramming] Radical default parenthesising method/idea > for any sentence fragment a, and noun b > 'a* b' would be equivalent to 'a * b' and 'a*b' and > equivalent to the existing parsing rules. > > No invalid syntax cases are created by the proposed > space conventions. But I screwed up in the proposal. > > There's a mistake in my original 2 simple rules. > Needs 3 rules instead. Hopefully > 1. replace " " to right of noun with ")" > 2. replace pattern noun-dyad-space with no space > between left noun and dyad with noun)dyad > 3. replace " " to left of noun with closing "(" > Ommitted implied rules: > - Left edge is equivalent to a space > - bracketing conjunctions and adverbs according to J > rules still takes precedence over verbs. > > So, Going back to nouns a,b,c: > ' c+a* b ' in a sentence fragment that could have more > to the left and right parses according to the 3 simple > rules as (c+a)* b... equivalent to the wordier (c+a)* > (b). ' c+a *b ' would also parse to the same > expression... but with wordier version: ' ((c+a)*b) ' > ' c+a * b ' is also the same expression. Wordy > version: ' (c+a) * (b) ' > > The equivalent human reading/writing rules are > "evaluate what is grouped together (and separated by > spaces) according to language parsing rules before > applying joining dyadic verbs." > > Another way of describing the algorithm (but less > machine friendly) is for any dyad, its left argument > is determined by putting closing brackets around the > first noun that is left bounded by a space, and its > right argument bounded by the noun is right bounded by > a space. > > Regarding a preprocessor, could it still be practical > for private use, even if no one else understood the > benefits of the syntax, and was ruled out of being > incorporated into the language? > > --- Alexander Schmolck <[EMAIL PROTECTED]> wrote: > > it's a reasonable idea, but maybe a bit tricky to > > get right. One problem is > > that it doesn't scale well at all (distingusihing > > between more than ``a*b`` > > and ``a * b`` is down the road to madness, IMO; but > > then what do you do about > > assymetrical ws as in ``a* b`` -- outlaw it?). > > > > > Having said that, why don't you try to implement a > > preprocessor for J or > > another language of your choice, and see how well it > > works in practice? > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
