Got it. Thank you.

On Thu, Jun 24, 2021 at 10:04 AM Matthew Flatt <[email protected]> wrote:

> Procedures with contracts are usually implemented by structs that have
> `prop:procedure`. Those applicable structs are not procedures from Chez
> Scheme's perspective. So, in the "Rumble" layer that bridges Chez
> Scheme and Racket, care must be taken to use a special `|#%app|` form
> instead of direct function application when the function to call might
> be from the Racket layer and implemented as an applicable struct.
>
> Parameters are implemented in the Rumble layer, but applying a
> parameter's guard procedure didn't use `|#%app|` as it should have. The
> repair was to add `|#%app|`.
>
> At Thu, 24 Jun 2021 09:55:39 -0400, David Storrs wrote:
> > Great! You're the best, Matt.  What was the issue, if it's simple enough
> to
> > explain?
> >
> > On Wed, Jun 23, 2021, 11:53 PM Matthew Flatt <[email protected]> wrote:
> >
> > > Hi David,
> > >
> > > Thanks for the report! This is fixed for the next release and in
> > > the current snapshots.
> > >
> > > The repair was commit
> > >
> > >   cb959879de21406571fb0127ded88c54e171c0eb
> > >
> > > See also https://github.com/racket/racket/issues/3865
> > >
> > >
> > > Matthew
> > >
> > >
> > > At Wed, 23 Jun 2021 22:30:53 -0400, David Storrs wrote:
> > > > I'm seeing an "invalid memory reference.  Some debugging context
> lost"
> > > > error when using a parameter that has a guard function AND the guard
> > > > function is user-defined AND the guard function has a contract on it.
> > > What
> > > > is the right place to file this aside from the list?
> > > >
> > > > Demonstration:
> > > >
> > > > #lang racket/base
> > > >
> > > > (require racket/contract)
> > > >
> > > > (define p1 (make-parameter ""))
> > > > (displayln "before set p1")
> > > > (p1 "ok")
> > > > (displayln "before read p1")
> > > > (p1)
> > > >
> > > > (define/contract p2 (parameter/c string?) (make-parameter ""))
> > > > (displayln "before set p2")
> > > > (p2 "ok")
> > > > (displayln "before read p2")
> > > > (p2)
> > > >
> > > >
> > > > (define/contract p3 (parameter/c string? integer?) (make-parameter
> "7"
> > > > string->number ))
> > > > (displayln "before set p3")
> > > > (p3 "8")
> > > > (displayln "before read p3")
> > > > (p3)
> > > >
> > > > (define (uncontracted-string->number v)
> > > >   (string->number v))
> > > >
> > > > (define/contract (contracted-string->number v)
> > > >   (-> string? number?)
> > > >   (string->number v))
> > > >
> > > > (define/contract p4  (parameter/c string? integer?)  (make-parameter
> "7"
> > > > uncontracted-string->number))
> > > > (displayln "before set p4")
> > > > (p4 "8")
> > > > (displayln "before read p4")
> > > > (p4)
> > > >
> > > > (define/contract p5  (parameter/c string? integer?)  (make-parameter
> "7"
> > > > contracted-string->number))
> > > > (displayln "before set p5")
> > > > (p5 "8")
> > > > (displayln "before read p5")
> > > > (p5) ; invalid memory reference.  Some debugging context lost
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > "Racket Users" group.
> > > > To unsubscribe from this group and stop receiving emails from it,
> send
> > > an email
> > > > to [email protected].
> > > > To view this discussion on the web visit
> > > >
> > >
> >
> https://groups.google.com/d/msgid/racket-users/CAE8gKoegLAOk9mHjKRNAJniki_6DHXJe
> > > > OKcjPFa75vPkJqemjw%40mail.gmail.com.
> > >
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKodFEaCLcviocskdiQ1iac7icxqt5sKyBD89Tafw%3DRZn6Q%40mail.gmail.com.

Reply via email to