W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

Re: [widgets] Null in P&C

From: Marcos Caceres <marcosc@opera.com>
Date: Tue, 2 Feb 2010 17:00:46 +0100
Message-ID: <b21a10671002020800v15b4779q4dfbc8ffc8f89046@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: public-webapps <public-webapps@w3.org>
On Tue, Feb 2, 2010 at 2:20 PM, Simon Pieters <simonp@opera.com> wrote:
> On Tue, 02 Feb 2010 13:29:42 +0100, Marcos Caceres <marcosc@opera.com>
> wrote:
>> Hi,
>> I had a discussion with an implementer who was a bit confused about the
>> concept of "null" in the specification. The problem is that I kinda wrote
>> the spec as if it was to be implemented in Java or JavaScript. This has
>> resulted in confusion wrt how "null" is to be interpreted in languages that
>> don't have that concept/data type.
>> So, in an effort to clarify that, I've added the following to Processing
>> Rules section of P&C:
>> [[
>> In the following algorithms, the concept of null is used as a special
>> symbol to indicate that a variable has no data associated with it. For
>> example, "let x be null" or "if y is empty, then return null".
>> Note: Although ECMAScript and Java support null as a native value type,
>> there are some programming languages that have no notion of null or where
>> null is problematic (e.g. C++). For those languages, it is OK for an
>> implementation to substitute the null for some other value or symbol (or for
>> nothing at all). For example, it is ok to have the value 0 represent null
>> for the height of a widget as the height of a widget is defined as a
>> non-negative integer greater than 0. In such a case, 0 would behave as if it
>> is null.
>> ]]
>> I don't have much experience programming in anything but Java and
>> ECMAScript (why would anyone program in something else?!;)), so please let
>> me know if it makes sense or if it could be better defined.
> HTML5 solves this with:
> "Conformance requirements phrased as algorithms or specific steps may be
> implemented in any manner, so long as the end result is equivalent."
> http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#conformance-requirements

yeah, that's pretty good... but the problem is still in the definition
of null, I feel. Anyway, hopefully with the clarification I've added,
everything will be clear enough. I've also added the text you
suggested above as a final fallback.

Marcos Caceres
Received on Tuesday, 2 February 2010 16:01:37 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:22 UTC