This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: rationals in guile?


On 12 Nov 1998, Valentin Kamyshenko wrote:

> To say truth, I do not understand, why rationals are not supported in
> many realizations of scheme (including that, which do support
> bignums). To make rationals as smobs (having bignums) seems to be
> nearly trivial, isn't it? 

yes.  I wouldn't call it trivial, but it wouldn't be too difficult.  The
catch is this:

If you're happy with your rationals being printed like

#<Rational: 21/13>

and being un-"read"-able, well then, there you are.

What I mean is that the hard part would be to make the Guile interpreter
correctly parse, read, and write "34/21" (or, God help us, "1+34/55i"). 


	Jay Glascoe
	jglascoe@jay.giss.nasa.gov