[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: A question on syntax shortcuts
With some of the stuff I am working on I am running into an abundance of parens. The paren shortcut allowing stuff like =bill.barnhill+tag1 was a big help. I still am collecting parens a bit though as many of the cross-refs I'm using are of the form a*(b/c), which I can't shorten to a*b/c. An example of this is the following XRI for XDI path language (XPL, something I'm working for submission to XRI/XDI but it's not cooked enough for submission yet) that represents the statement "Give me all articles tagged with the itag I input by the author with the iname I input that were published in the month of Nov 2006: ($var/+iname/1)/+article/+($var/+itag/2)+($cond/+gt/($date/2006-11-01))+ ($cond/+lt/($date/2006-12-01)) What I'd like is to be able to express that as one of the following (order is from more preferred to less) A) $$1:+iname/+article/+$$2:+itag+($cond/+gt/$date:2006-11-01)+($cond/+lt/$ date:2006-12-01) B) $$iname/+article/+$$itag+($cond/+gt/$date:2006-11-01)+($cond/+lt/$date:2 006-12-01) Option B would need the following additional rules: .. Any dollar word beginning with two $ is a variable, with the rest of the dollar word after the $$ being the variable name. Example: ($var/1) = $$1, Example: ($var/iname) => $$iname .. An cross-reference consisting of an absolute XRI with only a single segment non-xref authority and a single segment path can be abbreviated without parens by replacing the path delimiter with a colon, this is then called an abbreviated cross-reference. The portion of an abbreviated cross-reference before the colon is the qualifier, and the portion after the value of the abbreviated cross-reference. I think that this means an abbreviated cross-reference wouldn't be mistaken for a IRI as the IRI scheme couldn't be started with a GCS. Example: ($date/2006-12-01) => $date:2006-12-01 .. Within parsers the ':' operator is given higher precedence than the '/', '*', '!', '(', ')' operators, so a:b*c, a:b!c, a:b/c, a:b(c) will be treated respectively as (a/b)*c, (a/b)!c, (a/b)/c, (a/b)(c) Option A would need the same rules as option B, and the following rules: .. Any abbreviated cross-reference in which the qualifier is a variable has a value that represents the type of the data represented by the value of the variable. Example: $$1:+iname .. Specifying the type of a variable through an abbreviated cross-reference is optional. Example: The variable '1' might be expressed within an XPL expression as $$1 and represent any type of data, or as $$1:+iname and be expected to hold an iname (community or global). ** Is the $$ syntax cleaner than the longer ($var/type/instance) syntax? ** Is there a standard for this already (either a dollar word like $var or a shortcut like $$)? ** What are the issues in the above proposed rules and what do you think? Thanks, Bill
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]