---------- Forwarded message --------- From: Lingyu Zhu <lynus...@gmail.com> Date: Sun, Jan 17, 2021 at 8:33 PM Subject: Re: Cannot run picture language To: Taylor R Campbell <campb...@mumble.net>
Thanks Taylor, I replace '/' with quotient, but another error follows: The object #(65793 65793 ...), passed as an argument to x-bytes-into-image, is not the correct type. If type D, then edwin crashes, shows this message: The object -3, passed as an argument to vector-8b-ref, is not the correct type. By the way, '-edwin' option comes really handy, because otherwise I have to lauch edwin to load 6001 module. On Sun, Jan 17, 2021 at 2:52 AM Taylor R Campbell <campb...@mumble.net> wrote: > > > Date: Sat, 16 Jan 2021 10:41:49 -0800 > > From: Matt Birkholz <m...@birchwood-abbey.net> > > > > On Fri, 2021-01-15 at 23:12 +0800, Lingyu Zhu wrote: > > > 1 ]=> (paint g1 fovnder) > > > ;The object 65536/255, passed as the first argument to integer- > > >flonum, is not the correct type. > > > > This makes me wonder about line 69 of arith.scm: > > > > (define-standard-unary exact->inexact (lambda (x) x) int:->flonum) > > > > It seems reasonable to apply exact->inexact to a rational number yet > > the procedure uses int:->flonum which, reasonably, objects to > > arguments that are not integers so... perhaps screw with (broaden the > > domain of) int:->flonum with the following hack? > > 6001/arith.scm seems to be deliberately defined without rational > arithmetic. I don't know what the history behind it is, but the code > (exact->inexact (/ n-bins ...)) was probably intended to compute a > truncated integer quotient. You could probably get the intended > effect by writing (quotient n-bins ...) instead. > > Perhaps this code should omit (declare (usual-integrations)) so the > compiler won't replace (/ ...) by the primitive which does support > rational arithmetic (by punting to the runtime via the `generic > trampoline').