perl6-language
[Top] [All Lists]

Re: Some details of function return captures

To: perl6-language@perl.org
Subject: Re: Some details of function return captures
From: "John M. Dlugosz" <dhcgnd702@sneakemail.com>
Date: Sun, 10 Aug 2008 23:19:58 -0500
Delivered-to: mailing list perl6-all@perl.org
Delivered-to: perl6-all-poster@perl.org
Delivered-to: mailing list perl6-language@perl.org
Delivered-to: perl6-language@perl.org
In-reply-to: <200808102209.27185.thomas@sandlass.de>
List-help: <mailto:perl6-all-help@perl.org>
List-id: <perl6-all.perl.org>
List-id: <perl6-language.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: <1478-42616@sneakemail.com> <489C624C.1080704@barco.com> <18988-13584@sneakemail.com> <200808102209.27185.thomas@sandlass.de>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666
TSa (Thomas Sandlaß) thomas-at-sandlass.de |Perl 6| wrote:
.......
    my $x = |$obj.foo(1,2); #4

to keep the ReturnCapture, and call it later either explicitly

    $x.resume(3);

or implicitly

    $x = 3;


Hope that helps, TSa.

Interesting idea, as an alternative to get/set methods like Microsoft languages. Do you have a pointer to the thread, or collected notes I could read?

Is there anything in Perl 6 as it stands now that really uses continuations like this?

I don't like the default lvalue subs as the exist now because I might want to do more than assign to the value located with the access. Even if that's fine now, how do I add an "clear_cache; tell_subscribers;" after the value is changed? It means adding the ugly C++ form and then changing all existing uses. But, I realized that the ability to return a tied scalar as a proxy object gives us this. You can specify an accessor that returns an object that has the getter/setter installed in the FETCH/STORE routines. A class can be written for the purpose, that takes blocks (anonomous methods) in the constructor, and a macro gives reasonable syntactic sugar for writing separate get/set methods right by the attribute.

I'm not sure about returning things other than a scalar.

But the point is, since it _can_ be done in a module, I'm punting on that and not lobbying for it for 6.0 when there is so much else that needs doing.

--John


From: "John M. Dlugosz" <dhcgnd702@sneakemail.com>
X-Virus-Check-By: mailtest2.pair.com
X-Spam-Check-By: mailtest2.pair.com
X-Spam-Status: No, hits=-10.6 required=4.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 
autolearn=ham version=3.002004
X-Spam-Flag: NO
X-Spam-Level: X-Spam-Filtered: 052f96e22adcb440ba93d277d4a1272f
Mailing-List: contact perl6-all-help@perl.org; run by ezmlm
Precedence: bulk
List-Post: <mailto:perl6-all@perl.org>
List-Help: <mailto:perl6-all-help@perl.org>
List-Unsubscribe: <mailto:perl6-all-unsubscribe@perl.org>
List-Subscribe: <mailto:perl6-all-subscribe@perl.org>
List-Id: <perl6-all.perl.org>
Delivered-To: mailing list perl6-all@perl.org
Delivered-To: perl6-all-poster@perl.org
X-Mailing-List: contact perl6-language-help@perl.org; run by ezmlm
X-Mailing-List-Name: perl6-language
List-Id: <perl6-language.perl.org>
Delivered-To: mailing list perl6-language@perl.org
Delivered-To: perl6-language@perl.org
Message-ID: <19831-17172@sneakemail.com>
Date: Sun, 10 Aug 2008 23:22:08 -0500
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) 
Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: perl6-language@perl.org
Subject: Re: Allowing '-' in identifiers: what's the motivation?
References: <31238-20726@sneakemail.com> <489FB5FD.3030909@Yahoo.com>
In-Reply-To: <489FB5FD.3030909@Yahoo.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Old-Spam-Check-By: la.mx.develooper.com
X-Old-Spam-Status: No, hits=-3.6 required=8.0
        tests=BAYES_00,RCVD_IN_DNSWL_LOW

Austin Hastings Austin_Hastings-at-Yahoo.com |Perl 6| wrote:
At a minimum, there are more multi-word identifiers than there are statements involving subtraction. Further, '-' is basic, while all of [_A-Z] are not.

Ergo, a multi-word-identifier is easier to type than a multi_word_identifier or a multiWordIdentifier.

The older I get, the more I like Cobol, and now *ML, for getting this stuff right.

I do agree that it may be better for multi-word identifiers than camel case or underscores, as seen in many other languages that the great unwashed masses have never heard of. I tried it in my writings the same day.

--John


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