Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: CASE mis-understanding? Date: Thu, 27 Feb 2014 16:22:58 -0500 Organization: Aioe.org NNTP Server Lines: 25 Message-ID: References: <52e54d17.461102185@news.demon.co.uk> <7xppmks7v9.fsf@ruckus.brouhaha.com> <2014Feb18.181426@mips.complang.tuwien.ac.at> <7xmwhoi4px.fsf@ruckus.brouhaha.com> <7xeh2yi77o.fsf@ruckus.brouhaha.com> <7xlhx2rckq.fsf@ruckus.brouhaha.com> <7xy51275wq.fsf@ruckus.brouhaha.com> <7xsir9hwbh.fsf@ruckus.brouhaha.com> <2014Feb24.183059@mips.complang.tuwien.ac.at> <7x38j8rva9.fsf@ruckus.brouhaha.com> <2014Feb26.135958@mips.complang.tuwien.ac.at> <7xeh2pjisl.fsf@ruckus.brouhaha.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:28818 On Thu, 27 Feb 2014 05:54:10 -0500, Andrew Haley wrote: > Paul Rubin wrote: >> These days the very existence of null pointers should be seen as a >> language wart. Tony Hoare wrote in 2009: [claims worst mistake ever] > > Umm, how would you represent the end of a linked list? By a node > pointing to itself, maybe ... but that seems a bit kludgy and carries > its own problems. 1) You'd create your own NULL or NIL, by using a sentinel value or magic number, such as zero or all bits set, etc. 2) You'd use a flag, initially zero, which gets set to non-zero when a pointer is initialized with a value. This would produce an immense amount of additional code. So much so, it could be claimed that the NULL pointer, despite all it's inherent problems, is the better solution. http://en.wikipedia.org/wiki/Sentinel_value http://en.wikipedia.org/wiki/Magic_number_(programming) Rod Pemberton