Please get the #perl6 consensus then. I had suspected the answer would be that the solution would be the :ver code being able to see what :auth was selected and dispatch based on that. Otherwise supporting the wider version declaration to have a tree structure, where :ver was embedded inside :auth etc. Note that I raised this question on #perl6 myself shortly before writing perl6-language, but the email version is better organized. -- Darren Duncan

On 2015-06-10 11:38 PM, Tobias Leich wrote:
Hi, that is a very interesting use case, and IMO a very valid one.

Currently the semantics are, to also explain the correct syntax of the
pair that follows a 'use NAME':
:auth<Bar> and :ver<1.2> etc are of type Pair. Wenn the compiler hits a
use statement, it smartmatches
the distribution's auth/name/ver against the value of the corresponding

That means these Pairs are valid:

:auth<Bar> # match literally
:auth(/\w+/) # regex match
:auth($author) # okay if $author is known at compile time
:auth(*.chars == 6) # oaky, whatevercode
:auth({ $_.starts-with('Bla') }) # okay, closure
:auth(-> $auth { $auth ~~ /Bla/ }) # okay, something callable with arity
== 1
:auth({ $^auth ~~ /Bla/ }) # okay, something callable with arity == 1

That also means we cannot match different version patterns for different
:auth patterns, because we only
pass one value to the Pair's value to smartmatch against. What I can
imagine though is that if the matcher
is callable, and has an arity of 2, we pass the CompUnit as the first
and the $auth as the second argument.
That needs consensus in #perl6 though.

Cheers, Tobias

Am 11.06.2015 um 05:26 schrieb Darren Duncan:
So I have a question about versioning, either/especially about
compilation units, but also Perl 6 itself.

For context I refer to .

With regard to "use" statements and specifying 'auth' or 'ver' to
restrict between versions, it seems to me that the spec defines them
interacting in a cross-product fashion.

For example, given this possibly incorrect syntax:

     use Dog:auth<cpan:TPF cpan:JRANDOM>:ver(4-6, 10-15);

... that would be satisfied by any of TPF versions 4-6,10-15 or
JRANDOM versions 4-6,10-15.

However, what I want is to restrict the 'ver' differently depending on
the 'auth', treating them more as the hierarchy they are, assuming
that different authorities may go off and use different versioning

The question I have is how to 'or' the following into a single 'use
Dog' that isn't any less restrictive:

     use Dog:auth<cpan:TPF>:ver(v1.2.1..v1.2.3);
     use Dog:auth<cpan:JRANDOM>:ver(v14.3..v16.2);

That is, the cross-product answer is not restrictive enough.

I don't know if this hypothetical use case has been discussed before,
but if not, I hope that the Perl 6 specification has or can gain a
clean way to say how its done.

Thank you.

-- Darren Duncan

Reply via email to