Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion "hyper variables/references?

Newsgroups: perl.perl6.language
Path: controlnews3.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <la...@london.wall.org>
Mailing-List: contact perl6-language-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-langu...@perl.org
Received: (qmail 35686 invoked from network); 24 May 2004 00:40:23 -0000
Received: from x1.develooper.com (63.251.223.170)
  by onion.develooper.com with SMTP; 24 May 2004 00:40:23 -0000
Received: (qmail 4352 invoked by uid 225); 24 May 2004 00:40:22 -0000
Delivered-To: perl6-langu...@perl.org
Received: (qmail 4348 invoked by alias); 24 May 2004 00:40:22 -0000
X-Spam-Status: No, hits=2.6 required=7.0
	tests=RCVD_IN_DYNABLOCK,RCVD_IN_SORBS
X-Spam-Check-By: la.mx.develooper.com
Received: from pimout1-ext.prodigy.net (HELO pimout1-ext.prodigy.net) (207.115.63.77)
  by la.mx.develooper.com (qpsmtpd/0.27.1) with ESMTP; Sun, 23 May 2004 17:40:21 -0700
Received: from wall.org (adsl-64-172-34-33.dsl.snfc21.pacbell.net [64.172.34.33])
	by pimout1-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id i4O0eIK1208144
	for <perl6-langu...@perl.org>; Sun, 23 May 2004 20:40:18 -0400
Received: from london.wall.org (localhost.localdomain [127.0.0.1])
	by wall.org (8.12.11/8.12.10) with ESMTP id i4O0eGLT030969
	for <perl6-langu...@perl.org>; Sun, 23 May 2004 17:40:17 -0700
Received: (from larry@localhost)
	by london.wall.org (8.12.11/8.12.11/Submit) id i4O0eGEK030968
	for perl6-langu...@perl.org; Sun, 23 May 2004 17:40:16 -0700
Date: Sun, 23 May 2004 17:40:16 -0700
To: Perl Language <perl6-langu...@perl.org>
Subject: Re: "hyper variables/references?
Message-ID: <20040524004016.GA30741@wall.org>
Mail-Followup-To: Perl Language <perl6-langu...@perl.org>
References: <KKEPICKEKBFIGENPCEJIOEJLCDAA.cdutton@shaw.ca>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <KKEPICKEKBFIGENPCEJIOEJLCDAA.cdutton@shaw.ca>
User-Agent: Mutt/1.4.1i
X-Spam-Rating: onion.develooper.com 1.6.2 0/1000/N
Approved: n...@nntp.perl.org
From: la...@wall.org (Larry Wall)

On Sun, May 23, 2004 at 11:54:23AM -0700, Chris wrote:
: I may have missed an obvious answer to this question, but has any thought
: been given to allowing for variables which behave as though ever operation
: on them is the hyper version of that operation?  Sort of an automagical way
: of redefining a LOT of operators.

That's just regular overloading via multiple dispatch, I expect.  (You
could do the same in Perl 5, only without the multiple dispatch.)  To do
so generically you'd probably want to include the operators via role
rather than via inheritance to keep the dispatcher from taking their
generic "distance" into account, or you could end up calling the wrong
set of methods in pathological cases.

On the other hand, I can well imagine situations in which a PDLer might
just want to declare all operators to be hyper, in which case a pragma
would work nicely.  (Hyper operators degenerate to scalar if both sides
are ordinary scalars, but there's more bookkeeping, so it'd probably
run a little slower in some cases.  On the other hand, you wouldn't
have to put »« on any of your hyper ops, which is worth something...)

Larry