Re: [Scheme-reports] "force", "parameterize" implementation notes
Andy Wingo 06 Jan 2013 10:18 UTC
On Sun 06 Jan 2013 03:45, Alex Shinn <alexshinn@gmail.com> writes:
> I would use `exact-integer?' in the `radix' definition, and use
> `unless'.
>
> I've changed this to exact-integer?. We can't use unless
> because we have to return x - remember, the converter
> has to be idempotent ;)
Hah indeed ;-) It's not important, but what I meant was to also use a
`begin':
(lambda (x)
(unless (and (exact-integer? x)
...)
(error ...))
x)
This has the advantage that the call to `error' is not in tail position,
so you get the converter function on the stack, which can help
debugging. One day I'll implement JRM's stack history ring buffer
thing, but until then...
Cheers,
Andy
--
http://wingolog.org/
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports