mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Cannot run picture language


From: Lingyu Zhu
Subject: Fwd: Cannot run picture language
Date: Sun, 17 Jan 2021 20:36:12 +0800

---------- Forwarded message ---------
From: Lingyu Zhu <lynuszhu@gmail.com>
Date: Sun, Jan 17, 2021 at 8:33 PM
Subject: Re: Cannot run picture language
To: Taylor R Campbell <campbell@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 <campbell@mumble.net> wrote:
>
> > Date: Sat, 16 Jan 2021 10:41:49 -0800
> > From: Matt Birkholz <matt@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').



reply via email to

[Prev in Thread] Current Thread [Next in Thread]