RE: [racket-users] values considered harmful

2015-09-14 Thread Jos Koot
Koot [mailto:jos.k...@gmail.com] Sent: lunes, 14 de septiembre de 2015 14:09 To: 'Benjamin Greenman'; 'Racket Users' Cc: jos.k...@gmail.com Subject: RE: [racket-users] values considered harmful In the last line split&flip receives 0, but it needs a pair. The following wotk

RE: [racket-users] values considered harmful

2015-09-14 Thread Jos Koot
In the last line split&flip receives 0, but it needs a pair. The following wotks correct: #lang racket/base (define (split&flip xy) (define-values (x y) (values (car xy) (cdr xy))) (values y x)) ;; My mistake: x should be a pair (define-values (a b) (split&flip (cons 0 1))) (cons a b) ; -> (

Re: [racket-users] values considered harmful

2015-09-13 Thread Matthew Flatt
I've pushed a repair. At Sun, 13 Sep 2015 07:44:40 -0600, Matthew Flatt wrote: > Thanks for the help! > > When the optimize converts > > (let-values ([(X ...) (values M ...)]) >) > > to > > (let ([X M] ...) >) > > it incorrectly attaches a virtual timestamp to each "[X M]" b

Re: [racket-users] values considered harmful

2015-09-13 Thread Matthew Flatt
Thanks for the help! When the optimize converts (let-values ([(X ...) (values M ...)]) ) to (let ([X M] ...) ) it incorrectly attaches a virtual timestamp to each "[X M]" binding that corresponds to the timestamp after the whole `(values M ...)`. So, the optimizer loses the fa

Re: [racket-users] values considered harmful

2015-09-13 Thread antoine
Bonjour, The bytecode generated is: (begin (module test (require (lib "racket/base.rkt")) (provide) (module configure-runtime (require '#%kernel (lib "racket/runtime-config.rkt")) (provide) (print-as-expression '#t)) (define-values (_split&flip)

Re: [racket-users] values considered harmful

2015-09-13 Thread Daniel Brunner
What's really strange to me is that many versions of this program raise the expected "car: contract violation" error. For example, try changing the buggy line to `(values x y)` or `(values x x)` or even `(values (+ y) (+ x))`. Yeah, that's strange. I can confirm a segfault with v6.2 on Linux x8