Ticket #44 (closed defect)

Opened 16 years ago

Last modified 16 years ago

pseudo-parameter/c is borked

Reported by: dherman Owned by: dherman
Priority: major Milestone:
Component: dherman/parameter.plt Keywords:
Cc: Version:
Racket Version:

Description

Pseudo-parameters fail to fulfill pseudo-parameter/c. Example:

(module a scheme
  (require (planet dherman/parameter:1)
           scheme/contract)
  (define foo
    (let ([x 0])
      (make-pseudo-parameter
       (lambda () x)
       (lambda (v)
         (set! x v)
         v))))
  (provide/contract [foo (pseudo-parameter/c integer?)]))

Change History

Changed 16 years ago by dherman

  • status changed from new to closed

Fixed in version 1:2. You can't just provide/contract a struct-as-procedure by combining structure and procedure contracts, because it'll get wrapped as a regular procedure. So instead I used the low-level contract constructors to take a given pseudo-parameter and wrap it as a new pseudo-parameter with its underlying functions wrapped in projections.

Note: See TracTickets for help on using tickets.