[plt-scheme] to define, or to let

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Mar 23 11:36:03 EST 2004

At Tue, 23 Mar 2004 11:03:08 -0500, Joe Marshall wrote:
> Matthew Flatt <mflatt at cs.utah.edu> writes:
> 
> > At Tue, 23 Mar 2004 10:45:02 -0500, Joe Marshall wrote:
> >> When MzScheme encounters an error, by default it prints an error
> >> message and returns to the top level.  I don't care if it returns a
> >> 42, a list of 23 elements, or no values whatsoever.
> >
> > I do.
> 
> Which do you prefer?  Why?

I prefer that certain kinds of errors produce certain kinds of
exceptions, because it lets me build interesting programs from smaller
ones that I don't entirely trust.

> >> In unix, programs can (and often do) terminate with a bus-error or
> >> segmentation fault.  Suppose I redefined the library to make it
> >> impossible to end with a bus-error by protecting bus-mapped segments.
> >> Now I only get segmentation faults.  I think everyone will agree that
> >> this is change in the meaning (denotation) of an incorrect program.
> >> Do you care which OS error terminates your program?
> >
> > Yes. This specific example is why Adam and I prefer to debug MzScheme3m
> > in FreeBSD or Mac OS X, and not Linux.
> 
> What difference does it make?

When the OS distinguished seg faults and bus errors, a bus error is
handled as a write barrier, while a seg fault is a crash (typically due
to a bug in the GC). So we can tell gdb to ignore bus errors and stop
at a seg faults, which makes debugging easier.


There's nothing surprising about wanting specific information about an
error, so I must misunderstand your point.

Matthew



Posted on the users mailing list.