develooper Front page | perl.perl6.language | Postings from April 2005

Re: -X's auto-(un)quoting?

Thread Previous | Thread Next
From:
Juerd
Date:
April 22, 2005 12:09
Subject:
Re: -X's auto-(un)quoting?
Message ID:
20050422190921.GH19716@c4.convolution.nl
Matt skribis 2005-04-22 14:44 (-0400):
> We're talking about the *built-in* functions here, right?

I don't know.

> Anyway, is there any other URI scheme besides for mailto: that doesn't use  
> <://>?

I don't know, but if you want to find this out,
http://www.iana.org/assignments/uri-schemes is probably a good starting
point.

> mailto isn't something you can "open" really, for read at least.   

No, but writing to it ought to simplify things :)

    given open 'mailto:matt@weakmind.org' {
        .say(q0:to<.>
            Subject: Useful mailto open 
            User-Agent: Perl 6
            In-Reply-To: <op.spnc0sii8hsiyb@codeslut>
            
            Hello, world!
            .
        );
        .close or fail;
    }

> If it's for built-in, then only the most common protocols would be defined  
> I imagine.

No, if it's built in, we should stick to the spec and interpret every
^\w+: (roughly - see RFCs for syntax specifics) as a scheme.

> >>Also, I don't know much about rules with regex yet, but could you do
> >>something like...
> >>	multi sub open ($u of Str where /<protocol(file)>/, *@opts) returns
> >>Handle {...}
> >>Where < <protocol(file)> > expands to < file:// >
> >Yes, but it's probably easier to just use a hash: %protocol<file>.
> Easier or more efficient?

Yes.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About