Newsgroups: alt.lang.design,comp.lang.c++,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!spool.mu.edu!bloom-beacon.mit.edu!uhog.mit.edu!news.mathworks.com!newshost.marcam.com!charnel.ecst.csuchico.edu!waldorf.csc.calpoly.edu!kestrel.edu!mcdonald
From: mcdonald@kestrel.edu (Jim McDonald)
Subject: Re: Comparing productivity: LisP against C++
Message-ID: <1995Jan4.040950.2520@kestrel.edu>
Sender: mcdonald@saker.kestrel.edu (Jim McDonald)
Nntp-Posting-Host: saker.kestrel.edu
Organization: Kestrel Institute, Palo Alto, CA
References: <D18H22.2vt@world.std.com> <1994Dec23.022624.25607@kestrel.edu> <3dg0pf$m7f@celebrian.otago.ac.nz>
Date: Wed, 4 Jan 1995 04:09:50 GMT
Lines: 44
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:105837 comp.lang.lisp:16263

In article <3dg0pf$m7f@celebrian.otago.ac.nz>, nmein@bifrost.otago.ac.nz (Nick Mein) writes:
|> Jim McDonald (mcdonald@kestrel.edu) wrote:
|> 
|> : Excuse me?  The "first guy" (Nick) wrote a program that checked for about
|> : 1/100 of the errors that the lisp versions looked for
|> 
|> My error handling was minimal, but what possible error(s) would my
|> program not have caught?

For most, it's not so much that you wouldn't catch them but that
you wouldn't discriminate them.  E.g.  "file not found", "file system
not mounted", "protection violation", "network timed out", 
"cpu usage limit exceeded", etc. etc.

And the lisp code should also work on operating systems like
CMS on an IBM/370, etc. so the message might be something weird 
that you would never guess to check for, like "virtual disk not 
mounted" or whatever.  In short, a good lisp implementation should
*by default* discriminate intelligbly every possible variant of 
file access error.

More remotely, your file access could get interrupted by a signal
like SIGBUS or SIGINT, either accidentally, or maliciously, or 
because of some odd property of the file system being used that 
you as a programmer could not have anticipated.  By default, 
Lisp will say something like "Bus error" and let you examine 
the stack, abort, continue, etc.  

[And for what it's worth, these can be the most devilish bugs
 to track down.  For example, on some Sun Unixes if you deliver
 a SIGINT to a program paging in over the net, then as soon as 
 the SIGINT is started to be handled, a SIGBUS will be delivered 
 at the next page fault, which is typically caused by paging in
 the SIGINT handler!]

Of course, if you don't like the default handler you can easily
use your own in any given context to handle any desired level 
in the condition hierarchy (all I/O errors, or just file access 
errors, or all errors, or just directory protection violation,
or ...).




