racket / racket/option-contract

`option/c` works inconsistently in DrRacket

Open
#3 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
3
Forks
10
PR merge metrics
No merged PRs in 30d

Description

running this file:

#lang racket
(module thing racket
  (require racket/contract/option)
  (provide (contract-out [nothing proc/c] [something proc/c] [something* proc/c]))
  (define (my-list args) (list args))
  (define proc/c (option/c (-> any/c any/c) #:with-contract #t))
  (define something (λ (x) (my-list x)))
  (define something* (λ (x) (list x)))
  (define nothing (λ (x) '())))
(require rackunit 'thing)
(map value-contract `(,nothing ,something ,something*))
(check-equal? (value-contract something) (value-contract nothing))
(check-equal? (value-contract something) (value-contract something*))

in the command line produces the following (expected) output:

'(#<option> #<option> #<option>)

However running it in DrRacket (with dynamic properties set to 'Debugging', the default) produces the following:
image

I genuinely don't know whether to file this issue with racket, DrRacket, or option contracts. I'm happy to refile it elsewhere if needed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Racket reproduction in the command line and then in DrRacket with dynamic properties set to 'Debugging'. Compare the displayed results and trace whether the inconsistency belongs to option contracts or DrRacket; done means the example behaves consistently with the expected output.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.