Skip to content

contract-profile prints out the contract names incorrectly (using display instead of write) #6

@rfindler

Description

@rfindler

With this program:

#lang racket

(module m racket
  (provide
   (contract-out
    [f (-> (or/c slow? (or/c "x" "y")) any)]))
  (define (f x) x)
  (define (slow? x) (sleep 10) #t))

(require (submod "." m))

(void (f "x"))

when running the contract profiler, I see this output:

$  raco contract-profile x.rkt
Running time is 24.98% contracts
377/1509 ms

(-> (or/c slow? (or/c x y)) any)                                 377 ms
x.rkt:6:5                                                       
    f                                                            377 ms

but the contract name is wrong. There should be quotes around x and y.

The contract's name, however, is correct:

> (contract-name (value-contract f))
'(-> (or/c slow? (or/c "x" "y")) any)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions