[racket] a small itch regarding flonums

From: Stephan Houben (stephanh at planet.nl)
Date: Thu May 19 15:34:08 EDT 2011

On 05/19/2011 01:31 AM, Matthew Flatt wrote:
> At Mon, 16 May 2011 21:09:39 +0200, Stephan Houben wrote:
>> Why this difference? It looks like the r6rs fl+ gets open-coded
>> with some macro wizardry so there shouldn't be a performance penalty, right?
>
> I think it actually isn't. When you apply the R6RS `fl+' to two
> arguments, it's the Racket `fl+'. Otherwise, `fl+' calls a function
> that checks all arguments and then just uses `+'.

OK, I must admit that I didn't analyze it in full detail, I just
saw that some open-coding appeared to happen and assumed it
was happening for all arities.

> An obstacle to converting `fl+' to multiple `fl+' calls at the Racket
> level is the error message when the wrong sort of value is provided as
> one argument. I've considered making the error messages worse --- not
> mentioning the other arguments --- when reporting a bad argument, and
> then the error message wouldn't change if the arguments are rearranged.
> For now, though, I've opted to have only a two-argument `fl+'.

That's an issue I didn't even consider.
But obviously the binary fl+ is good enough.
As I said, it is just something which made me wonder.

Thanks,

Stephan


Posted on the users mailing list.