<HEAD><TITLE>discuss@charon: [1146] in "Coldmud discussion meeting"</TITLE>
<H1>[1146] in Coldmud discussion meeting</H1></HEAD>
<A HREF="/"><IMG SRC="/i-d.gif" ALT="root"></A>
<A HREF="?1146"><IMG SRC="/i-back.gif" ALT="meeting"></A>
<A HREF="/help.html"><IMG SRC="/i-help.gif" ALT="help"></A>
<A HREF="1"><IMG SRC="/i-first.gif" ALT="first"></A>
<A HREF="1141"><IMG SRC="/i-fref.gif" ALT="first in chain"></A>
<A HREF="1145"><IMG SRC="/i-pref.gif" ALT="previous in chain"></A>
<A HREF="1145"><IMG SRC="/i-prev.gif" ALT="previous"></A>
<A HREF="1147"><IMG SRC="/i-next.gif" ALT="next"></A>
<A HREF="1147"><IMG SRC="/i-nref.gif" ALT="next in chain"></A>
<A HREF="1149"><IMG SRC="/i-lref.gif" ALT="last in chain"></A>
<A HREF="1641"><IMG SRC="/i-last.gif" ALT="last"></A>
<HR><H2>Re: [COLD] scatter/optional assignments - request for discussion</H2>
<H3>daemon@ATHENA.MIT.EDU (Fri Nov 29 16:45:33 1996
)</H3>
<PRE>
Date: Fri, 29 Nov 1996 14:40:26 -0700 (MST)
From: Brandon Gillespie &lt;brandon@glacier.cold.org&gt;
To: Andrew Wilson &lt;andrew@aaaaaaaa.demon.co.uk&gt;
cc: Miroslav Silovic &lt;Miroslav.Silovic@public.srce.hr&gt;, coldstuff@cold.org
In-Reply-To: &lt;199611291948.TAA00594@aaaaaaaa.demon.co.uk&gt;

&gt; I didn't look too closely at this patch, but am I right in thinking
&gt; that the ?= operator is a simple test of existing value, rather
&gt; then an operation which is only performed if a variable has not
&gt; been assigned to previously?
&gt; 
&gt; Perl has a useful:
&gt; 
&gt; 	$foo = $bar unless $foo;
&gt; 
&gt; construction, which only assigns a value to $foo if no previous
&gt; assignment has taken place.
&gt; 
&gt; Wouldn't this be logic (expressed as '$foo ?= $bar') be more useful?
&gt; 
&gt; Ay (prepared to be clueless...)

IMHO no--perl's "unless" drives me up the wall (along with a few of its
other operators).  It changes the focus from left to right to right to
left simply for the fact that then it can use a cute word rather than an
operator and it supposedly makes 'sense' as you read it. Using ?= stays
left oriented, and fits in with existing operators, and is also shorter :) 
(it also 'reads' better IMHO):

   [foo, bar, 10 unless baz] = [1, 2]

vs:

   [foo, bar, baz ?= 10] = [1, 2]

And that is just in a simple scatter assignment :)

-Brandon

</PRE>
