perl6-language
[Top] [All Lists]

Re: Allowing '-' in identifiers: what's the motivation?

To: perl6-language@perl.org
Subject: Re: Allowing '-' in identifiers: what's the motivation?
From: "TSa (Thomas Sandlaß)" <thomas@sandlass.de>
Date: Mon, 11 Aug 2008 19:54:41 +0200
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: <31238-20726@sneakemail.com>
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
Organization: Thomas Sandlaß
References: <31238-20726@sneakemail.com>
User-agent: KMail/1.9.9
On Monday, 11. August 2008 05:35:03 John M. Dlugosz wrote:
> E.g. see <http://www.perlmonks.org/?node_id=703265> :
>
> sub bar {
>      return 100;
> }
> sub foo { 50;}
> sub foo-bar {
>    return  rand(50);
>    }
> if (foo - bar != foo-bar) {
>    print "Haha!\n";
> }

Actually I can even imagine allowing almost all chars
in the middle of identifiers. The price is that *all*
infix operators need spaces. This seems to be the trend
right now. See e.g. the disambiguation of meta reduce
and array constructors or adverbs versus nouns in the
call syntax.

So, how simple would a tokenizer become when whitespace
separates almost all tokens? Noteable exceptions would be
the pre- and postfix operators.


Regards, TSa.
-- 
"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan


From: "Mark J. Reed" <markjreed@gmail.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
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:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=mc17pjz34AF3x+mZ6MFUgs7grBRaU8ZQbQsDwIaRBK8=;
        b=m92gxIb+HtAS+ACzPyLQ2j9hA8Y94vT1C26vOi5C1bifEkrhl1sq3GAi4YlQJjn9Xw
         oYhGFnO/jtXDoY+uLzz0gnP/ZuYcSlEGHU7vaoyZYg1nj+UM65gDyaxD4Z9kVNm/BoIY
         lQX83xmrKeP4dU2VDeg284Xo0Tsb3cHxEqeAE=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=WSCAQ5KGmGReic3l4QqGD/+1TrYd7rF2wTw8yB2AtNDRlzhM7nW3Nv4VQvdvKYkdPR
         fF4znxYiC3Fv2hZsvvkGXppgFpOfWILlzXLk7snNkRGshemC06osX48SwgjI8zNrcvVN
         1oPc4/N0pp+t7dFedkCvd0MJArQ0abhqpugnk=
Message-ID: <f60fe000808111055y2879bbe3kd19f0030688f9fae@mail.gmail.com>
Date: Mon, 11 Aug 2008 13:55:32 -0400
To: "Tom Christiansen" <tchrist@perl.com>, Perl6 <perl6-language@perl.org>
Subject: Re: Allowing '-' in identifiers: what's the motivation?
In-Reply-To: <8873.1218476043@chthon>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <markjreed@gmail.com>
         <f60fe000808110607y3c8b85efj152b3a4f81a3c80d@mail.gmail.com>
         <8873.1218476043@chthon>
X-Old-Spam-Check-By: la.mx.develooper.com
X-Old-Spam-Status: No, hits=-2.6 required=8.0
        tests=BAYES_00,DK_SIGNED,SPF_PASS

On Mon, Aug 11, 2008 at 1:34 PM, Tom Christiansen <tchrist@perl.com> wrote:
> People use nonadic functions (nonary operators? where non = 0, not 9)
> without parens, and get themselves into trouble for it.

I believe the word you're looking for is '"nullary".  Such expressions
were covered in John's original message; I said that the presence of
sigils 'mitigated' the problem, not 'eliminated'.  It's one of the
reasons I'm still ambivalent..
Overall, though, it's not a deal-breaker for me one way or the other.


-- 
Mark J. Reed <markjreed@gmail.com>


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