[racket] compilation error in parameter.plt

From: Răzvan Rotaru (razvan.rotaru at gmail.com)
Date: Sun Jan 13 09:14:25 EST 2013

Thanks,

I have found out that you can apply your patches to the cache
(~/.racket/planet/300/5.2.1/cache/) and it works. This way you can at least
apply the fixes on your local machine. I don't know if and when the cache
files are refreshed with the version from planet (therefore overwriting my
patches), but until now the solution looks feasible.

In my case the problem is I don't get any reply from the package owner
(Dave Herman). Maybe the email address is not valid anymore.

Coming to the first issue, the compilation error is caused by a change in
the contract api. Here's the code that fails:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; I had to copy this from collects/scheme/private/contract-guts.ss
; because it isn't provided from scheme/contract.
(define (flat-proj ctc)
  (let ([pred? ((flat-get ctc) ctc)])
    (λ (pos neg src-info orig-str)
      (λ (val)
        (if (pred? val)
            val
            (raise-contract-error
             val
             src-info
             pos
             orig-str
             "expected <~a>, given: ~e"
             ((name-get ctc) ctc)
             val))))))

(define (pseudo-parameter/c c)
  (let ([c (coerce-contract pseudo-parameter/c c)])
    (make-proj-contract
     `(pseudo-parameter/c ,(contract-name c))
     (lambda (pos neg src-info name)
       (let* ([c-proj (if (flat-contract? c)
                          (flat-proj c)
                          ((proj-get c) c))]
              [pos-proj (c-proj pos neg src-info name)]
              [neg-proj (c-proj neg pos src-info name)])
           (lambda (p)
             (let ([getter (pseudo-parameter-getter p)]
                   [setter (pseudo-parameter-setter p)])
               (make-pseudo-parameter
                (lambda ()
                  (pos-proj (getter)))
                (lambda (x)
                  (setter (neg-proj x))))))))
     pseudo-parameter?/first-order)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

flat-get and proj-get don't exist anymore. I tried to find their
replacements, but I'm not familiar with the entire contract system, so I'm
basically wandering in the dark.

Does anybody know how to fix this code?

Thanks,
Razvan

On 12 January 2013 20:16, Asumu Takikawa <asumu at ccs.neu.edu> wrote:

> On 2013-01-09 14:49:34 +0200, Răzvan Rotaru wrote:
> >    [2]http://planet.racket-lang.org/trac/ticket/385
> >    Is there a way to push the fix back into the repository (other than
> >    emailing the owner)?
>
> I think the only way to upload new versions of a package onto PLaneT is
> to be the package owner. There are two options: you can e-mail the owner
> a patch or you can fork the package under a new name (this was done with
> ssax/sxml2 for example).
>
> Cheers,
> Asumu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130113/769c504a/attachment.html>

Posted on the users mailing list.