From owner-freebsd-questions@FreeBSD.ORG Tue Apr 6 02:56:37 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADD611065673 for ; Tue, 6 Apr 2010 02:56:37 +0000 (UTC) (envelope-from perrin@apotheon.com) Received: from outbound-mail-01.bluehost.com (outbound-mail-01.bluehost.com [69.89.21.11]) by mx1.freebsd.org (Postfix) with SMTP id 7759E8FC13 for ; Tue, 6 Apr 2010 02:56:37 +0000 (UTC) Received: (qmail 24004 invoked by uid 0); 6 Apr 2010 02:56:36 -0000 Received: from unknown (HELO box543.bluehost.com) (74.220.219.143) by cpoproxy1.bluehost.com with SMTP; 6 Apr 2010 02:56:36 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=apotheon.com; h=Date:From:To:Subject:Message-ID:Mail-Followup-To:References:Mime-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-Identified-User; b=FCxLMiYtO6rBfLYuBez5tsnO5RJff/lODIfTWeqB3pLjQeCJl5FEdtvcFk/jVV+smAUhQfSFPUrx/iAGnNi1nUwBG1z5O0I39COY30HQrgF98I16gE7rwFBYLIYh7fJ+; Received: from c-24-8-180-234.hsd1.co.comcast.net ([24.8.180.234] helo=kukaburra.hydra) by box543.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Nyyxv-0006Iv-9R for freebsd-questions@freebsd.org; Mon, 05 Apr 2010 20:56:36 -0600 Received: by kukaburra.hydra (sSMTP sendmail emulation); Mon, 05 Apr 2010 19:55:44 -0600 Date: Mon, 5 Apr 2010 19:55:44 -0600 From: Chad Perrin To: freebsd-questions@freebsd.org Message-ID: <20100406015544.GA21119@guilt.hydra> Mail-Followup-To: freebsd-questions@freebsd.org References: <4BB8108A.9080104@FreeBSD.org> <1270371713.5861.98.camel@tao.thought.org> <86aatjnsts.fsf@red.stonehenge.com> <861vevnsow.fsf@red.stonehenge.com> <20100404163353.GA15198@guilt.hydra> <20100404201442.b456044e.freebsd@edvax.de> <4BB9A5ED.3040309@infracaninophile.co.uk> <20100405173632.739a0c42@gumby.homeunix.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20100405173632.739a0c42@gumby.homeunix.com> User-Agent: Mutt/1.4.2.3i X-Identified-User: {2737:box543.bluehost.com:apotheon:apotheon.org} {sentby:smtp auth 24.8.180.234 authed with ren@apotheon.org} Subject: Re: perl qstn... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2010 02:56:37 -0000 --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 05, 2010 at 05:36:32PM +0100, RW wrote: >=20 > IMO this is a bad mistake that other languages were quite right not to > copy - a test shouldn't come after a block of code unless it's evaluated > after the block (as in repeat...until)=20 There are more things in heav'n and earth, Horatio, than are dreamt of by designers of eagerly evaluated prefix notation languages. Actually, I'd think that using "unless" that way would be right up the alley of the users of most programming languages, since "unless" is here just being used the same way as an infix notation operator with very high precedence. If you want to get rigorous about it, I'd prefer this approach: unless (condition) (result) =2E . . where it uses strict prefix notation. I know that some people think postfix notation is the bee's knees because of implementation reasons, but frankly, implementation should be something we never have to see, in my opinion -- unless we're actually implementing it. Computers are for scut work; humans are for idea work. Failing strict prefix notation, I'm okay with the way Perl and Ruby use "unless". This: (result) unless (condition) =2E . . could be explained away as fitting with any of: 1. conforming to natural language expectations, thus leaving implementation scut-work to the realm of the computer 2. infix notation with very high precedence for "unless" 3. lazy evaluation, where the (result) is not evaluated until it is needed, which gives the interpreter plenty of time to notice there's an "unless" immediately following it Obviously, the "real" answer in the case of Ruby and Perl falls somewhere around 1.5, but 3 is still a believable-sounding excuse, and perfectly acceptable to me. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAku6lKAACgkQ9mn/Pj01uKWwwgCcDGIgnxJN3Barid73ViqvY1xQ CSAAoO6L6lbh9+D7sI7HUqCVWKFLz0up =qz4D -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6--