racket/pict

add minimum size contract to `standard-fish`

開放

#85 建立於 2024年12月15日

 (1 則留言) (0 個反應) (0 位負責人)Racket (22 個分叉)github user discovery
good first issue

倉庫指標

星標
 (18 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

standard-fish fails for small values with an unfortunate error that unlike a normal error points elsewhere in the code.

standard-fish is defined at pict-lib/pict/private/utils.rkt

options:

  • check args are valid w>5 , h>1?
  • modify standard fish to accept any numbers, including zero and negative.
#lang racket
(require pict)
(standard-fish 6 1)
Documents/GitHub/racket/racket/collects/racket/contract/private/blame.rkt:350:0: draw-ellipse: contract violation
  expected: (and/c real? (not/c negative?))
  given: -2
  in: the 4th argument of
      (->m
       real?
       real?
       (and/c real? (not/c negative?))
       (and/c real? (not/c negative?))
       void?)
  contract from: (class record-dc%)
  blaming: (unit language@)
   (assuming the contract is correct)

貢獻者指南