Unix serial code: first version

Tim Rowledge tim at sumeru.stanford.edu
Sun Jul 16 01:13:38 UTC 2000


In message <3971090B.8C77E954 at bike-nomad.com> you wrote:

> Tim Rowledge wrote:
> 
> > > * error reporting (how is this handled generally? I don't see
> > > any easy way to pass back errno...)
> > I've previously suggested a simple way to pass error values back from
> > prims, but nobody wanted to bite and it is not currently implemented
> 
> What was your suggestion?
Change the compiler such that it auto-allocates a temp in any method
that calls a prim.  The prim code can then set that temp to any suitable
value (the nice thing is it doesn't have to be predetermined and can be
any object) and the prim failure backup code can use that to work out
why the prim failed. A simple example would be bitBLT failing because
the first co-ordinate was a float instead ofa SmallInteger; you could
set the error temp to make it quick and easy to fix that and retry.
Something similar exists in VW.

The cost is an extra temp for any prim-caller and a single test-branch
in the primitive callng code (IIRC).  Pretty trivial really.

 tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Porting is such sweet sorrow - Ed Luwish





More information about the Squeak-dev mailing list