John Porter wrote
> > I'm sure you don't want to write "$a = new Integer '32'".
>
> Of course. That would be unbearably absurd.
> But how often do you have to write expressions that
> operate on three or more URLs? Or even two?
> How many perl instrinsics return URLs? How many
> perl intrinsics operate on URLs in any way?
>
> > A related question is why we want to tie objects. Afterall,
> > you can use methods on an object without ever tying it!
>
> HTF does tying have anything to do with the current thread?
Since you ask so politely:
Tying is a mechanism by which a programmer can make an object
look like a built-in. This can be useful.
I was looking at the "http:...' as a specific example of a
general mechanism by which a programmer can make a class
behave like a built-in wrt its ctor.
I see this ability to define a new type of literal as being
analagous to tying. They are both special cases of the general
concept of using magic to hide the fact that you're using a
class. Obviously they are very different in the specifics.
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.
Dave.
--
Dave Whipp, Senior Verification Engineer,
Fast-Chip inc., 950 Kifer Rd, Sunnyvale, CA. 94086
tel: 408 523 8071; http://www.fast-chip.com
Opinions my own; statements of fact may be in error.