David Whipp writes:
: You may be right that there are no useful literals other than
: strings, integers, reals and lists. OTOH, if we are going to
: construct a meta-language which supports multiple syntaxes,
: then it is very likely that each application-specific language
: would have its own literals. The question becomes whether perl
: itself should have this ability.
What he said. To my mind, the question boils down to limiting the
scope of a syntactic rule borrowed from another lingo. So I can see
some potential in a general literal syntax resembling FOO:BAR where the
FOO class predeclares the method to parse and interpret the string
"BAR". (Larger scopes are also possible with other syntax, of course.)
The fact that this would make it possible to have an http literal is
interesting to me, but that's not the main point. (In fact, this whole
debate about whether the http class should be built-in or not is rather
beside the point from my perspective. It's defined by a class, so
we can do it either way. We can decide it one day before we ship 6.0.0.)
The fact that this metasyntax might also allow names of operator
variants to be disambiguated is also somewhat beside the point. The
point to me is the extension mechanism, not the extensions. The only
reason I'm looking at some of these possible extensions is to see some
of the directions such a mechanism might be taken.
Just because the general is visiting a particular trench doesn't mean
he plans to set up headquarters there. There are broader issues at
stake. So I'd appreciate it if my soldiers would refrain from killing
each other over what color to paint the foxhole.
Larry