Re: [racket-users] invalid memory error from parameter with contracted guard

2021-06-23 Thread Matthew Flatt
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 racket-users+unsubscr...@googlegroups.com.
> 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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20210623215345.2b1%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] invalid memory error from parameter with contracted guard

2021-06-23 Thread Gustavo Massaccesi
The list is fine, but sometimes messages are forgotten because it's
difficult to track them.

If you have a GitHub account, it's better to post is as an issue in
https://github.com/racket/racket

Gustavo


El mié, 23 de jun. de 2021 a la(s) 23:31, David Storrs (
david.sto...@gmail.com) escribió:

> 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 racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAE8gKoegLAOk9mHjKRNAJniki_6DHXJeOKcjPFa75vPkJqemjw%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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAPaha9Mny9p%3DWiypwBQGc8BV-3v-mixPL_%2BBd2O7LPoQDMPFeQ%40mail.gmail.com.


[racket-users] invalid memory error from parameter with contracted guard

2021-06-23 Thread David Storrs
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKoegLAOk9mHjKRNAJniki_6DHXJeOKcjPFa75vPkJqemjw%40mail.gmail.com.


[racket-users] SISAL like interpreters in racket/scheme

2021-06-23 Thread David Bremner


I'm interested in SISAL and the IF1 intermediate form. I found a
typescript based interpreter [1] and an old version of the original
compiler in CVS [2], but would love not to have to deal with typescript
or CVS. Toy subsets or similar languages welcome!

[1]: https://github.com/parsifal-47/sisal-is
[2]: http://sisal.sourceforge.net/

-- 
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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87fsx8joum.fsf%40tethera.net.