From: Clark C. E. <cc...@cl...> - 2004-09-11 21:14:50
|
In the discussion of proposal #4 (wart removal), we have been using the single ! as a short-cut for indicating strings. I propose two changes to %TAG as approved in #11 to make this happen, and to fix the habit of people omitting the ! ! when declaring a handle. %TAG ! <prefix-of-no-handle> <no-specific-value> %TAG !! <prefix-of-empty-handle> <no-specific-value> %TAG !<handle>! <prefix-of-handle> <no-specific-value> %TAG <handle> <prefix-of-handle> <no-specific-value> By default, there would be two %TAG directives in effect, %TAG ! ! tag:yaml.org,2002:str %TAG !! tag:yaml.org,2002: tag:yaml.org,2002:null This makes YAML types quite short, via !!int, and also provides a very quick short hand for strings, and the null YAML types. So, without an explicit %TAG directive, --- # from proposal number #11 private: !foo # !foo another: !foo::bar # !foo::bar uri: !tag:foo.com,2004:bar # !tag:foo.com,2004:bar + warning yaml: !!int # tag:yaml.org,2002:int handle: !baz!bar # -- error no %TAG for 'baz' -- # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags string: ! # tag:yaml.org,2002:str none: !! # tag:yaml.org,2002:null empty-handle: !baz! # -- error no %TAG for 'baz' -- ... If one were to provide a some explicit %TAGs %YAML 1.1 %TAG ! tag:yatl.org,2002: !bing %TAG !! tag:cla...@gm...,2004-08: urn:issn:1046-8188 %TAG baz http://clarkevans.com/baz/ tag:yaml.org,2002:str --- # from proposal number #11 private: !foo # tag:yatl.org,2002:foo another: !foo::bar # tag:yatl.org,2002:foo::bar uri: !tag:foo.com,2004:bar # tag:yatl.org,2002:tag:foo.com,2004:bar yaml: !!int # tag:cla...@gm...,2004-08:int handle: !baz!bar # http://clarkevans.com/baz/bar # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags string: ! # !bing none: !! # urn:issn:1046-8188 empty-handle: !baz! # tag:yaml.org,2002:str ... That's about it. The default tag isn't a prefix, it is a complete replacement for the particular item, and it need not be directly related to the prefix in question. An alternative proposal would have the <default> use the prefix, in this proposal, one would need to have !! to explicilty name a string. What do you all think? Clark |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-11 21:53:58
|
On Saturday 11 September 2004 05:14 pm, Clark C. Evans wrote: > =A0 %TAG ! =A0 =A0 =A0 =A0 =A0 <prefix-of-no-handle> =A0 =A0<no-specific-= value> > =A0 %TAG !! =A0 =A0 =A0 =A0 =A0<prefix-of-empty-handle> <no-specific-valu= e> > =A0 %TAG !<handle>! =A0<prefix-of-handle> =A0 =A0 =A0 <no-specific-value> > =A0 %TAG <handle> =A0 =A0<prefix-of-handle> =A0 =A0 =A0 <no-specific-valu= e> Don't like double defs. What if I want no-specific but not prefix? Try: =A0 %TAG * =A0 <NULL-substitute> %TAG ! <no-specific-substitute> %TAG !! <no-specific-substitute> %TAG !* <prefix-of-no-handle> %TAG !!* <prefix-of-empty-handle> %TAG !<handle>! <prefix-of-handle> =A0 %TAG <handle> =A0 <prefix-of-handle> The last is expection. But guess it's ok. =2D-=20 ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. =2DMark Twain |
From: Oren Ben-K. <or...@be...> - 2004-09-12 05:17:46
|
On Sunday 12 September 2004 00:53, trans. (T. Onoma) wrote: > Don't like double defs. What if I want no-specific but not prefix? First, I don't see this as a problem in practice. Why would anyone ever want to define !foo! without also defining !foo!bar? I can't imagine a scenario when that would be useful. But, suppose you do... just write: %TAG !foo! ? what-!foo!-means --- - !foo! # what-!foo!-means - !foo!bar # ?bar - neither private nor global error ... Remember, a cooked tag must either start with a '!' or be a valid URI. So here you explicitly said that you can't suffix !foo!. Problem solved! I like this proposal. Nice job, Clark. Have fun, Oren Ben-Kiki |
From: Clark C. E. <cc...@cl...> - 2004-09-11 22:15:45
|
On Sat, Sep 11, 2004 at 05:53:51PM -0400, trans. (T. Onoma) wrote: | Don't like double defs. Fair enough, it was a straw-man. The problem I'm trying to solve is two fold: - proposal #11 doesn't define the meaning of ! or !! or !bing! - it'd be nice to have ! mean tag:yaml.org,2002: - not necessary, but a shortcut for tag:yaml.org,2002:null would be nice - I'm not sure if this needs to be 'changable' A few other options, if a ! !! or !prefix! is missing the specific component, then it uses the kind of node as the specific. --- - ! # !str - ! {} # !map - ! [] # !seq - !! # tag:yaml.org,2002:str - !! {} # tag:yaml.org,2002:map - !! [] # tag:yaml.org,2002:seq ... Or, we could use a hard-coded rule, that never varies %TAG ! tag:ignored.clarkevans.com,2002: %TAG !! tag:ignored2.clarkevans.com,2002: - - ! # tag:yaml.org,2002:str - !bing # tag:ignored.clarkevans.com,2002:bing - !! # tag:yaml.org,2002:null - !!bing # tag:ignored2.clarkevans.com,2002:bing Or, we could have two different %TAG directives... (instead of using the special character '*') Thoughts? Clark |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-11 23:03:05
|
On Saturday 11 September 2004 06:15 pm, Clark C. Evans wrote: > On Sat, Sep 11, 2004 at 05:53:51PM -0400, trans. (T. Onoma) wrote: > | Don't like double defs. > > Fair enough, it was a straw-man. The problem I'm trying to > solve is two fold: > > - proposal #11 doesn't define the meaning of ! or !! or !bing! I thought it was nice that you could use those as shortcuts for what ever you want. Well, excepet for !bing!, that just looks like it ought to be a handle. But maybe that's too exceptional. ??? > - it'd be nice to have ! mean tag:yaml.org,2002: both ! and !! ? > - not necessary, but a shortcut for tag:yaml.org,2002:null would be nice hm. > - I'm not sure if this needs to be 'changable' Yes, I suppose it would be better if there were some consistant shorthands. > A few other options, if a ! !! or !prefix! is missing the specific > component, then it uses the kind of node as the specific. That's good. That would give a reasonable meaning to !bing! too. %TAG !bing! tag:bing.org,2002: --- - !bing! # tag:bing.org,2002:str - !bing! {} # tag:bing.org,2002:map ... Yes, I like. > --- > - ! # !str > - ! {} # !map > - ! [] # !seq > - !! # tag:yaml.org,2002:str > - !! {} # tag:yaml.org,2002:map > - !! [] # tag:yaml.org,2002:seq > ... > > Or, we could use a hard-coded rule, that never varies > > %TAG ! tag:ignored.clarkevans.com,2002: > %TAG !! tag:ignored2.clarkevans.com,2002: > - > - ! # tag:yaml.org,2002:str > - !bing # tag:ignored.clarkevans.com,2002:bing > - !! # tag:yaml.org,2002:null > - !!bing # tag:ignored2.clarkevans.com,2002:bing If hardcoded, then special character shorts maybe? --- !" # !str !~ # !null !? # !bool !$ # !currency !!" # !tag:yaml.org,2002:str !!~ # !tag:yaml.org,2002:null !!? # !tag:yaml.org,2002:bool !!$ # !tag:yaml.org,2002:currency Hmm.. a bit too long. Plus still looks like redefinable handle really. > Or, we could have two different %TAG directives... > (instead of using the special character '*') %PRE again? (Nah) Starting to feel back drift .... woooohhhh .... Ah well, what the hell! :) ^ for tag:yaml.org,2002: ? --- ^str 23 # tag:yaml.org,2002:str ^int 23 # tag:yaml.org,2002:int Shortcuts: ^" # tag:yaml.org,2002:str ^~ # tag:yaml.org,2002:null ^# # tag:yaml.org,2002:int ^% # tag:yaml.org,2002:float ^? # tag:yaml.org,2002:bool I like. You? -- ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. -Mark Twain |
From: David H. <dav...@bl...> - 2004-09-12 00:19:51
|
Clark C. Evans wrote: > On Sat, Sep 11, 2004 at 05:53:51PM -0400, trans. (T. Onoma) wrote: > | Don't like double defs. > > Fair enough, it was a straw-man. The problem I'm trying to > solve is two fold: > > - proposal #11 doesn't define the meaning of ! or !! or !bing! > - it'd be nice to have ! mean tag:yaml.org,2002: > - not necessary, but a shortcut for tag:yaml.org,2002:null would be nice > - I'm not sure if this needs to be 'changable' > > A few other options, if a ! !! or !prefix! is missing the specific > component, then it uses the kind of node as the specific. > > --- > - ! # !str > - ! {} # !map > - ! [] # !seq > - !! # tag:yaml.org,2002:str > - !! {} # tag:yaml.org,2002:map > - !! [] # tag:yaml.org,2002:seq > ... I like this much better. A slight variation, perhaps more regular, is: - ! # same as !str - ! {} # same as !map {} - ! [] # same as !seq [] - !! # same as !!str - !! {} # same as !!map {} - !! [] # same as !!seq [] -- David Hopwood <dav...@bl...> |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 05:46:09
|
Just playing around. Thought I'd share. rules: - all tags are laid against - or : - ^ refers to handle and sets cut if handle given - * refers to handle if given, otherwise yaml (does not set cut) - no tag char means local example: %TAG big tag:big.com,2004: %TAG handle tag:lite.com,2004: --- -handle^str 23 # tag:lite.com,2004:str -^map # tag:lite.com,2004:map a:big*str # tag:big.com,2004:str a:^str 1 # tag:lite.com,2004:str b:^int 2 # tag:lite.com,2004:int c:^float 3 # tag:lite.com,2004:float -*seq [1,2,3] # tag:yaml.org,2002:seq -ser 23 # :ser (local) - 23 # NULL:str - [1,2,3] # NULL:seq -- ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. -Mark Twain |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 06:30:37
|
On Sunday 12 September 2004 01:46 am, trans. (T. Onoma) wrote: > %TAG big tag:big.com,2004: =A0 > =A0 %TAG handle tag:lite.com,2004: > =A0 --- > =A0 -handle^str 23 =A0 # tag:lite.com,2004:str > =A0 -^map =A0 =A0 =A0 =A0 =A0 =A0# tag:lite.com,2004:map > =A0 =A0 a:big*str =A0 =A0 =A0# tag:big.com,2004:str > =A0 =A0 a:^str 1 =A0 =A0 =A0 # tag:lite.com,2004:str > =A0 =A0 b:^int 2 =A0 =A0 =A0 # tag:lite.com,2004:int > =A0 =A0 c:^float 3 =A0 =A0 # tag:lite.com,2004:float > =A0 -*seq [1,2,3] =A0 =A0# tag:yaml.org,2002:seq > =A0 -ser 23 =A0 =A0 =A0 =A0 =A0# :ser (local) > =A0 - 23 =A0 =A0 =A0 =A0 =A0 =A0 # NULL:str > =A0 - [1,2,3] =A0 =A0 =A0 =A0# NULL:se oops, ignore duplicate key. =2D-=20 ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. =2DMark Twain |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 15:26:38
|
On Sunday 12 September 2004 01:46 am, trans. (T. Onoma) wrote: > Just playing around. Thought I'd share. > > rules: > > - all tags are laid against - or : > - ^ refers to handle and sets cut if handle given > - * refers to handle if given, otherwise yaml (does not set cut) > - no tag char means local > > example: > > %TAG big tag:big.com,2004: > %TAG handle tag:lite.com,2004: > --- > -handle^str 23 # tag:lite.com,2004:str > -^map # tag:lite.com,2004:map > a:big*str # tag:big.com,2004:str > a:^str 1 # tag:lite.com,2004:str > b:^int 2 # tag:lite.com,2004:int > c:^float 3 # tag:lite.com,2004:float > -*seq [1,2,3] # tag:yaml.org,2002:seq > -ser 23 # :ser (local) > - 23 # NULL:str > - [1,2,3] # NULL:seq of course one can just ditch the extra character saving 1st rule and go back to the ! (which is how got there from here to begin with ;) %TAG big tag:big.com,2004: %TAG handle tag:lite.com,2004: --- - !handle^str 23 # tag:lite.com,2004:str - !^map # tag:lite.com,2004:map a: !big*str # tag:big.com,2004:str A: !^str 1 # tag:lite.com,2004:str b: !^int 2 # tag:lite.com,2004:int c: !^float 3 # tag:lite.com,2004:float - !*seq [1,2,3] # tag:yaml.org,2002:seq - !ser 23 # :ser (local) - 23 # NULL:str - [1,2,3] # NULL:seq The we ask ourselves, what does ! !^ and !* mean by themselves.... Next time on.... Late night syntax scrabble. :) -- ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. -Mark Twain |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 06:23:46
|
On Sunday 12 September 2004 01:17 am, Oren Ben-Kiki wrote: > On Sunday 12 September 2004 00:53, trans. (T. Onoma) wrote: > > Don't like double defs. What if I want no-specific but not prefix? > > First, I don't see this as a problem in practice. Why would anyone ever > want to define !foo! without also defining !foo!bar? I can't imagine a > scenario when that would be useful. =46irstly, =A0 %TAG ! =A0 ? tag:yaml.org,2002:str Secondly it allows silliness, %TAG !double-entendre! =A0tag:yaml.org,2002: =A0 tag:bink.org,2002:bloo= per If that should not be allowed then why not just: %TAG !better! =A0tag:yaml.org,2002: =A0 better But finally, I do not like look of !tag! that is not a handle, and theref= or=20 can mean anything under the sun.=20 %TAG !whatami! =A0tag:yaml.org,2002: =A0 ! And more fun! Add, %TAG ! ? =A0 !whatami! Think its better if !tag! were to imply !tag!{kind}. Then by default. - !! 23 # tag:yaml.org,2002:str Simple. > But, suppose you do... just write: > > %TAG !foo! ? what-!foo!-means > > --- > - !foo! # what-!foo!-means > - !foo!bar # ?bar - neither private nor global error > ... > > Remember, a cooked tag must either start with a '!' or be a valid URI. > So here you explicitly said that you can't suffix !foo!. Problem > solved! And %TAG !foo! %^$(*U%(##(%^*)#&^#)(&^)#(&^)$#? what-!foo!-means works too. =2D-=20 ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. =2DMark Twain |
From: Oren Ben-K. <or...@be...> - 2004-09-12 16:16:08
|
On Sunday 12 September 2004 09:23, trans. (T. Onoma) wrote: > > First, I don't see this as a problem in practice. Why would anyone > > ever want to define !foo! without also defining !foo!bar? I can't > > imagine a scenario when that would be useful. > > Firstly, > > =A0 %TAG ! =A0 ? tag:yaml.org,2002:str If you want to forbid all "!foo" tags... sure. But 99% of the people=20 would prefer: %TAG ! ! tag:yaml.org,2002:str (That is, '!foo' is cooked as '!foo' - a private tag; a simple '!' is=20 cooked as 'tag:yaml.org,2002:str' - a string). > Secondly it allows silliness ... why not just: > > %TAG !better! =A0tag:yaml.org,2002: =A0 better Yes, Clark also thought of that. It is a rather arbitrary restriction,=20 and there _are_ cases when having the 'default' have a different=20 namespace is very reasonable. In fact, we use one - the single '!'=20 meaning a string :-) > But finally, I do not like look of !tag! that is not a handle, and > therefor can mean anything under the sun. I don't see what you mean by "not a handle". Do you mean "not a prefix"? > %TAG !whatami! =A0tag:yaml.org,2002: =A0 ! So, you have a problem with: %TAG !whatami! =A0tag:yaml.org,2002: =A0 ! --- !whatami! stuff # Cooked to '!' ... Why? The author clearly stated what he means by writing '!foo!'. You may=20 disagree violently with this as a matter of style (and I'd be with=20 you), but then again if someone wrote an integer like this: --- int: "\ \ 1\ 0\ 20\ \ 01\ \ " You'd also freak out (and rightly so). So? If we try to lay down rules=20 that allow only "good style", we would we fail, _and_ we'll incur the=20 wrath of 90% of the users (who each will strongly disagree at with=20 least one of our rules - a different one for each user of course). > And more fun! Add, > > %TAG ! ? =A0 !whatami! This means that '!foo' is an error and that a single '!' is cooked to=20 '!whatami!' - a private tag. Again, this is valid, though bizarre. Note that the problem is inherent in having %TAG in the first place. In=20 the old #11 proposal, you could write: %TAG ! !@#$%^!)(* Which would mean that '!foo' would be cooked as '!@#$%^!)(*foo'. Again,=20 valid and bizarre, but I'm not going to even try to lay down rules on=20 what is a "nice" private tag name and what isn't. > Think its better if !tag! were to imply !tag!{kind}. Then by > default. > > - !! 23 # tag:yaml.org,2002:str You mean: - !! 23 # tag:yaml.org,2002:scalar The three kinds are mapping, sequence and scalar (NOT hash-table, array=20 and string). So it doesn't work the way you expect. It also doesn't=20 allow the author to override it; it requires '!! 23' instead of '! 23';=20 and it doesn't allow for neat NULLs. All in all, I'd say that Clark's=20 notion is still better. Have fun, Oren Ben-Kiki |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 16:53:41
|
On Sunday 12 September 2004 12:16 pm, Oren Ben-Kiki wrote: > > Think its better if !tag! were to imply !tag!{kind}. Then by > > default. > > > > - !! 23 # tag:yaml.org,2002:str > > You mean: > > - !! 23 # tag:yaml.org,2002:scalar > > The three kinds are mapping, sequence and scalar (NOT hash-table, array > and string). So it doesn't work the way you expect. It also doesn't > allow the author to override it; it requires '!! 23' instead of '! 23'; > and it doesn't allow for neat NULLs. All in all, I'd say that Clark's > notion is still better. Sure, I see your point about not cramping peoples style, but like the model= =20 itself shouldn't there be some reasonable bounds? I realize the kinds are: mapping, sequence and scalar; when translated to=20 yaml.org,2002:, or another domain, I assumed they would become map, seq, st= r.=20 As far as I know, there isn't any such thing as a tag:yaml,2002:scalar=20 =2D-scalar being a kind and not a type. So my point is simply that, while having merits, its getting a bit too=20 "loopy". That may not make much sense to you. But let me put it this way. I= f=20 there's one thing I'm good for, its an acid test for KISS. I generally don'= t=20 have time for complexity. As for ! by itself. It's quite magical -- translating into yaml.org,2002:st= r=20 by default. I think Clark was suggesting it be generalized to yaml.org,200= 2: {kind} --assuming the translations I mentioned above. So, I was just taking= =20 that one step further and applying it to !! and !handle!, and the ! can sti= ll=20 mean local. So the magic bullet becomes !!. But it's much more consitant=20 behavior. Unfortunately it's one char longer --no I don't like it either. M= y=20 hope is that there is still a very consitant behavior that'll work better,= =20 for us yet to discover. While we're on the subject, I want to suggest that we keep a form of cut an= d=20 paste. It occurred to me that in some cases all those handles might need a= =20 little help (in fact this is what got me playing syntax scrabble). Have a=20 look: %TAG !big! tag:big.com,2004: =A0 =A0%TAG !handle! tag:lite.com,2004: =A0 =A0--- =A0 =A0- !handle!str 23 =A0 # tag:lite.com,2004:str =A0 =A0- !handle!map =A0 =A0 =A0 =A0=A0 =A0# tag:lite.com,2004:map =A0 =A0 =A0a: !big!str =A0 =A0 =A0# tag:big.com,2004:str =A0 =A0 =A0A: !handle!str 1 =A0 =A0 =A0# tag:lite.com,2004:str =A0 =A0 =A0b: !handle!int 2 =A0 =A0 =A0# tag:lite.com,2004:int =A0 =A0 =A0c: !handle!float 3 =A0 =A0# tag:lite.com,2004:float =A0 =A0- !!seq [1,2,3] =A0 =A0 # tag:yaml.org,2002:seq =A0 =A0- !ser 23 =A0 =A0 =A0 =A0 =A0 # !ser (local) =A0 =A0- 23 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # NULL =A0 =A0- [1,2,3] =A0 =A0 =A0 =A0 =A0 # NULL With cut & paste: %TAG !big! tag:big.com,2004: =A0 =A0%TAG !handle! tag:lite.com,2004: =A0 =A0--- =A0 =A0- !handle!str 23 =A0 # tag:lite.com,2004:str =A0 =A0- !^!map =A0 =A0 =A0 =A0 =A0 =A0 # tag:lite.com,2004:map =A0 =A0 =A0a: !big!str =A0 =A0 =A0 # tag:big.com,2004:str =A0 =A0 =A0A: !handle!str 1 =A0 # tag:lite.com,2004:str =A0 =A0 =A0b: !^!int 2 =A0 =A0 =A0 # tag:lite.com,2004:int =A0 =A0 =A0c: !^!float 3 =A0 =A0 # tag:lite.com,2004:float =A0 =A0- !!seq [1,2,3] =A0 =A0 # tag:yaml.org,2002:seq =A0 =A0- !ser 23 =A0 =A0 =A0 =A0 =A0 # !ser (local) =A0 =A0- 23 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # NULL =A0 =A0- [1,2,3] =A0 =A0 =A0 =A0 =A0 # NULL If you look at my syntax scrabble you will see the similarity --with one=20 exception, in it there is a way to specify a handle w/o setting the "clip=20 board" ( plus they are all one char shorter ;). =2D-=20 ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. =2DMark Twain |
From: Oren Ben-K. <or...@be...> - 2004-09-12 17:17:59
|
On Sunday 12 September 2004 19:53, trans. (T. Onoma) wrote: > So my point is simply that, while having merits, its getting a bit > too "loopy". I don't know... its just a simple substitution. However, I don't feel _that_ strongly about it. The disadvantages of your proposal are: - Can't be overriden - could be viewed as a feature; - Requires keeping !!map, !!seq and !!str in the core spec. Not a big problem. - No nice syntax for null. Not a big deal either. I'm happy with ~. - Requires using '!!' rather than '!' for '- !! 23'. Not a big deal, again, and can actually be seen as a feature (makes it clear it is a "global" tag like "!!int" and so on). So, yes, I can live with your proposal. For anyone not keeping track: %TAG !<handle>! <prefix> <default-suffix> As I said, Clark has also raised this option. But he didn't defend it as tenaciously :-) If Clark also likes your proposal, and Brian has no problem - fine. > While we're on the subject, I want to suggest that we keep a form of > cut and paste. So much for KISS! :-) Seriously, this isn't necessary. Since the prefixes are completely under the author's control, you can just use a single-letter prefix. This way when you cut&paste from one place in the document to another you don't have to worry about all these '^'. Not to mention they are ugly :-) Have fun, Oren Ben-Kiki |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 18:41:51
|
On Sunday 12 September 2004 01:17 pm, Oren Ben-Kiki wrote: > On Sunday 12 September 2004 19:53, trans. (T. Onoma) wrote: > > So my point is simply that, while having merits, its getting a bit > > too "loopy". > > I don't know... its just a simple substitution. However, I don't feel > _that_ strongly about it. The disadvantages of your proposal are: I wouldn't really call it my proposal as I also would prefer something a little more refined. But its all have been able to come with that's seems highly consistant. > - No nice syntax for null. Not a big deal either. I'm happy with ~. !!~ ? > So, yes, I can live with your proposal. For anyone not keeping track: > > %TAG !<handle>! <prefix> <default-suffix> > > As I said, Clark has also raised this option. But he didn't defend it as > tenaciously :-) If Clark also likes your proposal, and Brian has no > problem - fine. > > > While we're on the subject, I want to suggest that we keep a form of > > cut and paste. > > So much for KISS! :-) > > Seriously, this isn't necessary. Since the prefixes are completely under > the author's control, you can just use a single-letter prefix. This way > when you cut&paste from one place in the document to another you don't > have to worry about all these '^'. Not to mention they are ugly :-) I guess that's true. Okay. -- ( o _ // trans. / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. -Mark Twain |
From: Clark C. E. <cc...@cl...> - 2004-09-12 17:24:12
|
On Sun, Sep 12, 2004 at 12:53:36PM -0400, trans. (T. Onoma) wrote: | %TAG !big! tag:big.com,2004: | %TAG !handle! tag:lite.com,2004: | --- | - !handle!str 23 # tag:lite.com,2004:str | - !^!map # tag:lite.com,2004:map | a: !big!str # tag:big.com,2004:str | A: !handle!str 1 # tag:lite.com,2004:str | b: !^!int 2 # tag:lite.com,2004:int | c: !^!float 3 # tag:lite.com,2004:float | - !!seq [1,2,3] # tag:yaml.org,2002:seq | - !ser 23 # !ser (local) | - 23 # NULL | - [1,2,3] # NULL %TAG !B! tag:big.com,2004: %TAG !L! tag:lite.com,2004: --- - !L!str 23 # tag:lite.com,2004:str - !L!map # tag:lite.com,2004:map a: !B!str # tag:B.com,2004:str A: !L!str 1 # tag:lite.com,2004:str b: !L!int 2 # tag:lite.com,2004:int c: !L!float 3 # tag:lite.com,2004:float - !!seq [1,2,3] # tag:yaml.org,2002:seq - !ser 23 # !ser (local) - 23 # NULL - [1,2,3] # NULL *bing* Clark |
From: Clark C. E. <cc...@cl...> - 2004-09-12 17:20:58
|
this is a review of options to satisfy a goal to extend/modify #11 to map ! to tag:yaml.org,2002:str ; of course, if you don't like the idea of getting rid of style distinction, this is all moot. --- - name: handle-prefix-alternative detail: we extend the %tag declaration syntax, %tag handle prefix alternate see the lead post for this thread for details. if the specific part is missing, then alternate is used example: %tag ! !prefix: !alternative --- - ! # !alternative - !bing # !prefix:bing impact: - straightforward simple rule - allows ! to map to tag:yaml.org,2002:str - allows ! to be private tags - perhaps unexpected results, but trainable - name: handle-prefix-default detail: almost like handle-prefix-alternative only that a missing specific, implies prefix+deffault used example: %tag ! !prefix: default --- - ! # !prefix:default - !bing # !prefix:bing impact: - straightforward simple rule - perhaps more consistent than handle-prefix-alternative - either one of the following: a) !private tags, but !! for tag:yaml.org,2002:str b) !!private tags and ! for tag:yaml.org,2002:str - name: fixed-cooking detail: we leave the %tag mechanism as-is. and provide two simple rules: - ! is cooked to tag:yaml.org,2002:str - !! is cooked to tag;yaml.org,2002:null - !handle! remains an error example: --- - ! # tag:yaml.org,2002:str - !bing # !prefix:bing impact: - very simple rule - allows ! to map to tag:yaml.org,2002:str - allows ! to be private tags - is not changable by user, no equivalent mechansim for !handle! - name: kind based defaults detail: similar to fixed-cooking, only that a handle w/o a specific component is mapped to the prefix, plus the name of the kind. example: %tag ! ! # default rule %tag !! tag:yaml.org,2002: # default rule %pre !handle! tag:clarkevans.com,2002: --- - ! # !scalar - ! {} # !mapping - !bing # !bing - !! # tag:yaml.org,2002:scalar - !!bing # tag:yaml.org,2002:bing - !handle! # tag:clarkevans.com,2002:scalar - !handle!bing # tag:clarkevans.com,2002:bing variant: A variant of this proposal makes ! the yaml prefix, and !! private tags. This has the advantage of keeping YAML 1.0 semantics, and also allowing ! to be tag:yaml.org,2002:scalar impact: - simple, but somewhat magical - keeps ! as private, but ! - allows ! to map to tag:yaml.org,2002:scalar (but not str) - name: two-directives detail: Keep the %TAG director from #11, but rename it to %PRE, add a new %TAG that is a simple match/replace version. The rules then match on %TAG first, and for those that have not applied, use %PRE example: %PRE ! ! # default rule %PRE !! tag:yaml.org,2002: # default rule %TAG ! tag:yaml.org,2002:str # default rule %TAG !! tag:yaml.org,2002:null # default rule %PRE !handle! tag:clarkevans.com,2002: %TAG !handle!exception tag:yatl.org,2002:exception --- - ! # tag:yaml.org,2002:str - !bing # !bing - !! # tag:yaml.org,2002:null - !!bing # tag:yaml.org,2002:bing - !handle! # tag:yatl.org,2002:exception - !handle!bing # tag:clarkevans.com,2002:bing impact: - two directives; but both are farily simple - interactions of the directives could be confusing - perhaps too much flexibility? - allows ! to map to tag:yaml.org,2002:str - allows ! to be private tags - name: wild tags detail: Something simlar to what T.Onoma had proposed, immediately in is reply to my first post in this thread. A limited version of this is two-directives. example: (similar to two-tags, but uses !* to mean %PRE ) Well, that's the options I've seen thus far. Clark |
From: Oren Ben-K. <or...@be...> - 2004-09-12 17:31:02
|
On Sunday 12 September 2004 20:20, Clark C. Evans wrote: > this is a review of options... > name: handle-prefix-alternative +1. > name: handle-prefix-default Also +1. Maybe even +1.00001. > name: fixed-cooking +0. Too magical for my taste. > name: kind based defaults -1. I find it too restrictive. > name: two-directives +0. It works but is an overkill. > Well, that's the options I've seen thus far. I think if I have to choose I'll go with Onoma's handle-prefix-default. It seems the cleanest - by a hair. handle-prefix-alternative is right behind it. And while we are at it, if I had my way we'd reverse the default !! and !, but Brian would have smilodons so I'm not even writing this sentence :-) Have fun, Oren Ben-Kiki |
From: Clark C. E. <cc...@cl...> - 2004-09-12 18:09:55
|
On Sun, Sep 12, 2004 at 08:30:57PM +0300, Oren Ben-Kiki wrote: | > name: handle-prefix-default | Also +1. Maybe even +1.00001. It seems T. prefers this alternative as well. So I've updated the proposal, calling it #11c. The impact together with proposal #4 (wart removal) is that you need !! to turn-off NULL regex-based typing. Of course, since this stuff is all in the Application's domain anyway, it's perfectly acceptable to use ! all by itself to load as a string. Cheers. | And while we are at it, if I had my way we'd reverse the default !! | and !, but Brian would have smilodons so I'm not even writing this | sentence :-) Na. I kinda like ! as private tags. *bings* Clark |
From: trans. (T. Onoma) <tra...@ru...> - 2004-09-12 18:49:48
|
On Sunday 12 September 2004 01:30 pm, Oren Ben-Kiki wrote: > On Sunday 12 September 2004 20:20, Clark C. Evans wrote: > > this is a review of options... > > name: handle-prefix-alternative > > +1. > > > name: handle-prefix-default > > Also +1. Maybe even +1.00001. LOL :) > I think if I have to choose I'll go with Onoma's handle-prefix-default. > It seems the cleanest - by a hair. handle-prefix-alternative is right > behind it. > > And while we are at it, if I had my way we'd reverse the default !! > and !, but Brian would have smilodons so I'm not even writing this > sentence :-) %TAG ! !! %TAG !! ! *bing* ? -- ( *) _ // T. Onoma / \ tra...@ru... I don't give a damn for a man that can only spell a word one way. -Mark Twain |
From: Clark C. E. <cc...@cl...> - 2004-09-12 17:32:30
|
one more alternative, - name: is-private-rule detail: we loosen the %TAG declaration to allow for ! !! and !handle! so that they expand only to the !handle! example: %TAG ! ! %TAG |! tag:yaml.org,2002: --- - 23 # NULL - ! 23 # ! - !bing # !bing - !! # tag:yaml.org,2002: - !!str # tag:yaml.org,2002:bing ... impact: - well, since NULL tag is totally configurable meaning of application, no reason why app can't use ! to map to a string; but alas this is a configuration issue - !! becomes an undefined tag, so not really useable This one is perhaps the simplest, and most consistent. However, it means that the tag ! would be changed to tag:yaml.org,2002:str in the 'specification' stage. Cheers, Clark On Sun, Sep 12, 2004 at 01:20:57PM -0400, Clark C. Evans wrote: | this is a review of options to satisfy a goal to extend/modify #11 | to map ! to tag:yaml.org,2002:str ; of course, if you don't like the | idea of getting rid of style distinction, this is all moot. | | --- | - | name: handle-prefix-alternative | detail: | we extend the %tag declaration syntax, | %tag handle prefix alternate | see the lead post for this thread for details. if | the specific part is missing, then alternate is used | example: | %tag ! !prefix: !alternative | --- | - ! # !alternative | - !bing # !prefix:bing | impact: | - straightforward simple rule | - allows ! to map to tag:yaml.org,2002:str | - allows ! to be private tags | - perhaps unexpected results, but trainable | - | name: handle-prefix-default | detail: | almost like handle-prefix-alternative only that | a missing specific, implies prefix+deffault used | example: | %tag ! !prefix: default | --- | - ! # !prefix:default | - !bing # !prefix:bing | impact: | - straightforward simple rule | - perhaps more consistent than handle-prefix-alternative | - either one of the following: | a) !private tags, but !! for tag:yaml.org,2002:str | b) !!private tags and ! for tag:yaml.org,2002:str | - | name: fixed-cooking | detail: | we leave the %tag mechanism as-is. and provide two simple | rules: | - ! is cooked to tag:yaml.org,2002:str | - !! is cooked to tag;yaml.org,2002:null | - !handle! remains an error | example: | --- | - ! # tag:yaml.org,2002:str | - !bing # !prefix:bing | impact: | - very simple rule | - allows ! to map to tag:yaml.org,2002:str | - allows ! to be private tags | - is not changable by user, no equivalent mechansim for !handle! | - | name: kind based defaults | detail: | similar to fixed-cooking, only that a handle w/o a specific | component is mapped to the prefix, plus the name of the kind. | example: | %tag ! ! # default rule | %tag !! tag:yaml.org,2002: # default rule | %pre !handle! tag:clarkevans.com,2002: | --- | - ! # !scalar | - ! {} # !mapping | - !bing # !bing | - !! # tag:yaml.org,2002:scalar | - !!bing # tag:yaml.org,2002:bing | - !handle! # tag:clarkevans.com,2002:scalar | - !handle!bing # tag:clarkevans.com,2002:bing | variant: | A variant of this proposal makes ! the yaml prefix, and !! | private tags. This has the advantage of keeping YAML 1.0 | semantics, and also allowing ! to be tag:yaml.org,2002:scalar | impact: | - simple, but somewhat magical | - keeps ! as private, but ! | - allows ! to map to tag:yaml.org,2002:scalar (but not str) | - | name: two-directives | detail: | Keep the %TAG director from #11, but rename it to %PRE, | add a new %TAG that is a simple match/replace version. | The rules then match on %TAG first, and for those that | have not applied, use %PRE | example: | %PRE ! ! # default rule | %PRE !! tag:yaml.org,2002: # default rule | %TAG ! tag:yaml.org,2002:str # default rule | %TAG !! tag:yaml.org,2002:null # default rule | %PRE !handle! tag:clarkevans.com,2002: | %TAG !handle!exception tag:yatl.org,2002:exception | --- | - ! # tag:yaml.org,2002:str | - !bing # !bing | - !! # tag:yaml.org,2002:null | - !!bing # tag:yaml.org,2002:bing | - !handle! # tag:yatl.org,2002:exception | - !handle!bing # tag:clarkevans.com,2002:bing | impact: | - two directives; but both are farily simple | - interactions of the directives could be confusing | - perhaps too much flexibility? | - allows ! to map to tag:yaml.org,2002:str | - allows ! to be private tags | - | name: wild tags | detail: | Something simlar to what T.Onoma had proposed, immediately | in is reply to my first post in this thread. A limited | version of this is two-directives. | example: | (similar to two-tags, but uses !* to mean %PRE ) | | Well, that's the options I've seen thus far. | | Clark | | | ------------------------------------------------------- | This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 | Project Admins to receive an Apple iPod Mini FREE for your judgement on | who ports your project to Linux PPC the best. Sponsored by IBM. | Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php | _______________________________________________ | Yaml-core mailing list | Yam...@li... | https://lists.sourceforge.net/lists/listinfo/yaml-core -- Clark C. Evans Prometheus Research, LLC. http://www.prometheusresearch.com/ o office: +1.203.777.2550 ~/ , mobile: +1.203.444.0557 // (( Prometheus Research: Transforming Data Into Knowledge \\ , \/ - Research Exchange Database /\ - Survey & Assessment Technologies ` \ - Software Tools for Researchers ~ * |
From: Oren Ben-K. <or...@be...> - 2004-09-12 19:15:18
|
On Sunday 12 September 2004 20:32, Clark C. Evans wrote: > name: is-private-rule -1. I hate it that we encourage people to use different names for the same thing. It messes with the "tag == name of type" concept. I think #11c is it... Have fun, Oren Ben-Kiki |
From: Clark C. E. <cc...@cl...> - 2004-09-12 17:58:29
|
summary: Ok. This is an updated "patch" to #11 %TAG proposal, let's call this #11c, it allows a "handle" to appear by itself, and in this case an optional default specific is used. Further this allows !handle! to omit the exclamation marks within the %TAG proposal. If the default is missing, it is the empty string. detail: The %TAG directive has thre specific formats, %TAG ! <prefix-of-no-handle> <default-specific>? %TAG !! <prefix-of-empty-handle> <default-specific>? %TAG !<handle>! <prefix-of-handle> <default-specific>? %TAG <handle> <prefix-of-handle> <default-specific>? By default, there would be two %TAG directives in effect, %TAG ! ! %TAG !! tag:yaml.org,2002: str example: --- # from proposal number #11 private: !foo # !foo another: !foo::bar # !foo::bar uri: !tag:foo.com,2004:bar # !tag:foo.com,2004:bar + warning yaml: !!int # tag:yaml.org,2002:int handle: !baz!bar # -- error no %TAG for 'baz' -- # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags also-private: ! # ! string: !! # tag:yaml.org,2002:str empty-handle: !baz! # -- error no %TAG for 'baz' -- ... If one were to provide a some explicit %TAGs %YAML 1.1 %TAG ! tag:yatl.org,2002: wibble %TAG !! tag:cla...@gm...,2004-08: hmm %TAG baz http://clarkevans.com/baz/ --- # from proposal number #11 private: !foo # tag:yatl.org,2002:foo another: !foo::bar # tag:yatl.org,2002:foo::bar uri: !tag:foo.com,2004:bar # tag:yatl.org,2002:tag:foo.com,2004:bar yaml: !!int # tag:cla...@gm...,2004-08:int handle: !baz!bar # http://clarkevans.com/baz/bar # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags also-private: ! # tag:yaml.org,2002:wibble string: !! # tag:cla...@gm...,2004-08:hmm empty-handle: !baz! # http://clarkevans.com/baz/ ... notes: This proposal allows but does not mandate that the '!' tag to be loaded as what ever an application wishes, including a native string. But this, like the option to do regex-based typing based on the NULL tag is completely under the application's control. Of course, we could provide a 'standard' description of this mechanism together with standard regex mappings to YAML tags in a separate specification, and encourage implementations to make this default behavior standard. |
From: Tim H. <tim...@co...> - 2004-09-12 19:07:21
|
Clark C. Evans wrote: >summary: > Ok. This is an updated "patch" to #11 %TAG proposal, let's call > this #11c, it allows a "handle" to appear by itself, and in this > case an optional default specific is used. Further this allows > !handle! to omit the exclamation marks within the %TAG proposal. > If the default is missing, it is the empty string. > >detail: > The %TAG directive has thre specific formats, > > %TAG ! <prefix-of-no-handle> <default-specific>? > %TAG !! <prefix-of-empty-handle> <default-specific>? > %TAG !<handle>! <prefix-of-handle> <default-specific>? > %TAG <handle> <prefix-of-handle> <default-specific>? > > I'd ditch the alternate spelling <handle> and insist on !<handle>!. The tag notation is pretty close to alphabet soup as is and allowing multiple spellings of the same thing, particularly when one of them (<handle>) is inconsistent with the rest is going to cause confusion. I'm still going back and forth as to whether <default-specific> is needless complexity or important flexibility. Other than that, this may be (marginally) simpler than the alternatives while allowing everyone one enough rope to shoot themselves in their preferred appendage. > By default, there would be two %TAG directives in effect, > > %TAG ! ! > %TAG !! tag:yaml.org,2002: str > > Why bother? It seems simpler to just have ! and !! cook to themselves: %TAG ! ! %TAG !! !! Since the application controls all this anyway, it can make things work and we can move some complexity out of tagging and into the application / schema. Since a 'standard' descriptions will need to supplied anyway, it can just as easily map '!' (or '!!') tagged items to string as it can map NULL tagged items to implicit. Call this #11C1 An even simpler is to have unspecified tags just map to themselves. This might hide errors, but presumably the application / schema will catch them. Call this #11C2. example (adjusted for 11C1/2): --- # from proposal number #11 private: !foo # !foo another: !foo::bar # !foo::bar uri: !tag:foo.com,2004:bar # !tag:foo.com,2004:bar + warning yaml: !!int # !!int handle: !baz!bar # -- error no %TAG for 'baz' (1) or !baz!bar (2) # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags also-private: ! # ! string: !! # !! empty-handle: !baz! # -- error no %TAG for 'baz' (1) or !baz! ... If one were to provide a some explicit %TAGs %YAML 1.1 %TAG ! tag:yatl.org,2002: wibble %TAG !! tag:cla...@gm...,2004-08: hmm %TAG !baz! http://clarkevans.com/baz/ --- # from proposal number #11 private: !foo # tag:yatl.org,2002:foo another: !foo::bar # tag:yatl.org,2002:foo::bar uri: !tag:foo.com,2004:bar # tag:yatl.org,2002:tag:foo.com,2004:bar yaml: !!int # tag:cla...@gm...,2004-08:int handle: !baz!bar # http://clarkevans.com/baz/bar # from wart propoal #4 nulltag: # NULL (a special non-value) # default-tags also-private: ! # tag:yaml.org,2002:wibble string: !! # tag:cla...@gm...,2004-08:hmm empty-handle: !baz! # http://clarkevans.com/baz/ ... >notes: > This proposal allows but does not mandate that the '!' tag to be > loaded as what ever an application wishes, including a native > string. But this, like the option to do regex-based typing based > on the NULL tag is completely under the application's control. > Of course, we could provide a 'standard' description of this > mechanism together with standard regex mappings to YAML tags > in a separate specification, and encourage implementations to > make this default behavior standard. > > To make the above work, the 'standard' mechanism would also want to treat '!' tagged scalars as tag:yaml.org,2002:str And '!!x" tagged scalars as tag:yaml.org,2002:x. But all of this would be at the application/schema level. This is all just pushing complexity around, but I think that since YAML files want to be human editable, pushing complexity up to the application is good in this case. -tim > > >------------------------------------------------------- >This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 >Project Admins to receive an Apple iPod Mini FREE for your judgement on >who ports your project to Linux PPC the best. Sponsored by IBM. >Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php >_______________________________________________ >Yaml-core mailing list >Yam...@li... >https://lists.sourceforge.net/lists/listinfo/yaml-core > > > |
From: Oren Ben-K. <or...@be...> - 2004-09-12 19:22:14
|
On Sunday 12 September 2004 22:07, Tim Hochberg wrote: > I'd ditch the alternate spelling <handle> and insist on !<handle>!. +1 on that. I never liked the special case for dropping the !. %TAG <how-the-prefix-looks-EXACTLY> <what-the-prefix-is-replaced-by-EXACTLY>. > I'm still going back and forth as to whether <default-specific> is > needless complexity or important flexibility. Other than that, this > may be (marginally) simpler than the alternatives while allowing > everyone one enough rope to shoot themselves in their preferred > appendage. :-) > > By default, there would be two %TAG directives in effect, > > > > %TAG ! ! > > %TAG !! tag:yaml.org,2002: str > > Why bother? It seems simpler to just have ! and !! cook to > themselves: > > %TAG ! ! > %TAG !! !! No, this is missing the point. > Since the application controls all this anyway, it can make things > work and we can move some complexity out of tagging and into the > application / schema. The point is the schema doesn't transform tags. If the tag of a node is !, it is !, and not tag:yaml.org,2002:str, and no schema can say it is tag:yaml.org,2002:str (an application can... but not a YAML schema). We want it to be painless to use schemas where strings are tag:yaml.org,2002:str (for interoperability). Otherwise, if you follow your argument to its logical conclusion, we don't need any global tags in the first place. I _really_ don't want to go over the whole argument again (It took what - at least week - last time? please not again :-) Have fun, Oren Ben-Kiki |
From: David H. <dav...@bl...> - 2004-09-12 19:28:56
|
Oren Ben-Kiki wrote: > On Sunday 12 September 2004 22:07, Tim Hochberg wrote: > >>I'd ditch the alternate spelling <handle> and insist on !<handle>!. > > +1 on that. I never liked the special case for dropping the !. %TAG > <how-the-prefix-looks-EXACTLY> > <what-the-prefix-is-replaced-by-EXACTLY>. +1. Me too. Otherwise I'm happy with #11c. -- David Hopwood <dav...@bl...> |