perl6-internals
[Top] [All Lists]

Re: [perl #58236] [TODO][PDD19] make decision on open issue on .return d

To: "Allison Randal" <allison@perl.org>
Subject: Re: [perl #58236] [TODO][PDD19] make decision on open issue on .return directive in pdd19
From: "Klaas-Jan Stol" <parrotcode@gmail.com>
Date: Sat, 30 Aug 2008 11:16:31 +0200
Cc: perl6-internals@perl.org
Delivered-to: mailing list perl6-all@perl.org
Delivered-to: perl6-all-poster@perl.org
Delivered-to: mailing list perl6-internals@perl.org
Delivered-to: perl6-internals@perl.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=WIgsU4jyUFxNvtyMH0vkIrSdouzolb2O3aKyqDFFYYQ=; b=UkIM/752SRzY2IKDhKjAB0r5TcF8N/1fpU/HISGYtY+iJjLXmc7TRwmonNLXjNLGjD YDkrZGGIi2+2LYrZ9dmvZwRxz6ubxtwlAZxugUkyMfpwCSZl2VioskHBmrUFdaYELIIs ByOvs5/IcimxpCzif1HheuAIR54+JEkk8RB5c=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=ITXCWMaRMbXlFHTGZKLvRi6fgh7Z8QeXA3vOiO3PmqeHJmrvjK2xVtx9IgzF8mI08/ lt9XVmQP7SotofzH6lZJXEkJAOnZwF/fQEFGuz9TNoTb6//Pdu9m5y8qIBllBmA3AHk1 bKdjJJsq/EWEaSB79xhh9HkZc2IXkYXR6lPVg=
In-reply-to: <48B90D02.80605@perl.org>
List-help: <mailto:perl6-all-help@perl.org>
List-id: <perl6-all.perl.org>
List-id: <perl6-internals.perl.org>
List-post: <mailto:perl6-all@perl.org>
List-subscribe: <mailto:perl6-all-subscribe@perl.org>
List-unsubscribe: <mailto:perl6-all-unsubscribe@perl.org>
Mailing-list: contact perl6-all-help@perl.org; run by ezmlm
References: <RT-Ticket-58236@perl.org> <7b0e52b40808220315t1d360f05ob14a2c9184907063@mail.gmail.com> <rt-3.6.HEAD-29762-1219400211-1603.58236-72-0@perl.org> <48B90D02.80605@perl.org>
On Sat, Aug 30, 2008 at 11:04 AM, Allison Randal <allison@perl.org> wrote:

> Klaas-Jan Stol (via RT) wrote:
>
>>
>> The parentheses surrounding the arguments are mandatory. Besides making
>> sequence break more conspicuous, this is necessary to distinguish this
>> syntax from other uses of the C<.return> directive that will be probably
>> deprecated.
>>
>>
>> The open issue of the 'probably deprecation' should be decided on; what
>> return directive is meant here that supposedly would be deprecated?
>> Will it? (any need?)
>>
>
> Yes, it will be deprecated, or at least renamed. The C<.return> directive
> without parentheses is an old convention for passing a single return result,
> and must always be sandwiched between  C<.begin_return> and C<.end_return>.


Do you mean this one? (see next)

.begin_return
.return "hi"
.return 42
.return 3.14
.end_return

(which is the same as:   .return ("hi", 42, 3.14)       )
Is the purpose of renaming this to make a clear distinction between the
'.return' directive in this long style of returning and the short one
('.return ()' )   ?


>
> And, there's another C<.return> without parentheses that performs a
> tail-call, invoking a sub or method reusing the same return continuation.
>  This should also be renamed.


Is the purpose to be more explicit on being a tailcall? (in that case, it
could be renamed as ".tailcall" or whatever -- but that's obvious)

>
>
> The only directive that should be named C<.return> is the one that returns
> a value or values (i.e. it's syntactic sugar for a whole collection of
> low-level directives/opcodes).


and this would be:     .return ("hi", 42, 3.14)
right?

>
>
> Allison


kjs
<Prev in Thread] Current Thread [Next in Thread>