From: Oren Ben-K. <or...@ri...> - 2001-11-09 07:14:24
|
I wrote: > > > This difference emerged after Brian gave the > > > use case of putting a regular expression > > > as a value. Clark's answer was "too bad", > > > (a) use a multi-line scalar, or (b) quote > > > the regular expression, or (c) let's introduce > > > an implict "regex" type starting with the ` tick. > > Oh, just find some prefix to attach to regexps and be done with... Silly me, I completely missed the point - I thought you were talking about regexp as an implicit type, while you meant "a string value containing a regexp". Hmmm. The one-line block syntax makes some sense for that, but consider that: regexp: !text ... line noise here ... Is currently a legal way of doing this. I think "line noise as text value" is rare enough that an explicit '!text' annotation is acceptable (even in Perl :-). The in-line block syntax seems more trouble than it is worth. My proposal for changing the reference syntax from '*' to '->' still stands, however. You may have noted I changed the base64 syntax from [...data...] to [=...data...=], due to the same reason: using a single prefix character is like using a type A IP network or a TLD; it should only be done for an extremely good reason. I feel '=' is a case where a one-char type is acceptable, and also '~'. Both are actually single-char values rather than a single-char prefixes; so in theory '~/=...data...' implicit types could still be used, though of course their relationship with '='/'~' would become an issue. At any rate, I would definitely draw the line there. Wasting '*' seems like, well, a waste :-) Besides, '->' may be more readable to a newbie. Have fun, Oren Ben-Kiki |