From stefanML at collocations.de  Wed Sep 15 09:54:50 2010
From: stefanML at collocations.de (Stefan Evert)
Date: Wed, 15 Sep 2010 09:54:50 +0200
Subject: [Rd] warning or error upon type/storage mode coercion?
In-Reply-To: <4C90200D.2030208@gmail.com>
References: <4C90200D.2030208@gmail.com>
Message-ID: <57738BDD-C024-4E96-80A5-C3AB9B7EBA64@collocations.de>


On 15 Sep 2010, at 03:23, Benjamin Tyner wrote:

> 2. So, assuming the answer to (1) is a resounding "no", does anyone care to state an opinion regarding the philosophical or historical rationale for why this is the case in R/S, whereas certain other interpreted languages offer the option to perform strict type checking? Basically, I'm trying to explain to someone from a perl background why the (apparent) lack of a "use strict; use warnings;" equivalent is not a hindrance to writing bullet-proof R code.

If they're from a Perl background, you might also want to point out to them that (base) Perl doesn't do _any_ type checking at all, and converts types as needed.  As in ...

$x = "0.0";
if ($x) ... # true
if ($x+0) ... # false

AFAIK, that's one of the main complaints that people have about Perl.  "use strict" will just make sure that all variables have to be declared before they're used, so you can't mess up by mistyping variable names.  Which is something I'd very much like to have in R occasionally ...

Best,
Stefan



[Rd] warning or error upon type/storage mode coercion?
Stefan Evert