[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: small integers
- To: Simon Spero <ses@SUNSITE.UNC.EDU>
- Subject: Re: small integers
- From: Scott_Fahlman@SEF-PMAX.SLISP.CS.CMU.EDU
- Date: Sat, 10 Oct 92 22:38:31 -0400
- Cc: info-dylan@CAMBRIDGE.APPLE.COM
- In-reply-to: Your message of Sat, 10 Oct 92 20:44:35 -0500. <9210110044.AA26238@SunSite.unc.edu>
One idea I had for dealing with fixnums overflowing and either turning into
bignums, or signaling and exception was to use the concept of retry handlers;
there could be a pair of retry handlers, one of which would convert the
result to a bignum and return, the other of which would just re-raise the
condition. The programmer could select which handler he wanted active; the
protocol in force should be determinable statically in most cases.
I don't think this will work. The fact that a function will return only a
fixnum, if it returns anything at all, must be known at compile time if you
are to generate optimal code. Handlers are established dynamically, not
lexically, so the compiler could not be sure what policy would be in effect
when a function is called.
I don't understand your other suggestion.
-- Scott
===========================================================================
Scott E. Fahlman
School of Computer Science
Carnegie Mellon University
5000 Forbes Avenue
Pittsburgh, PA 15213
Internet: sef+@cs.cmu.edu