develooper Front page | perl.perl6.language.data | Postings from September 2000

Re: RFC 82 (v3) Arrays: Apply operators element-wise in a list context

Thread Previous | Thread Next
From:
Chaim Frenkel
Date:
September 9, 2000 19:33
Subject:
Re: RFC 82 (v3) Arrays: Apply operators element-wise in a list context
Message ID:
m37l8l3rib.fsf@csamnycln01.nyc.csam.com
>>>>> "NT" == Nathan Torkington <gnat@frii.com> writes:

NT> Actually, the only refinement I'd like to see is that boolean operators
NT> (==, &&, ||) be excepted from the distributive rule.

NT> This is to permit:

NT>   if (@a == @b)		# shallow comparison

NT> and

NT>   @a = @b || @c;	# @a=@b or @a=@c;	# ish

NT> The math operations are fine to apply to each element.  I have no
NT> problem with those being distributive, but I think || for default
NT> values and == for comparison are too ingrained and they'd be too
NT> useful (as opposed to a distributive || or &&, which is much less
NT> useful).


Then how would one get the distributed effect? An apply operator?

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
chaimf@pobox.com				               +1-718-236-0183

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About