PasteRack.org
Paste # 49920
2022-01-14 19:52:33

Forked from paste # 32847.

Fork as a new paste.

Paste viewed 141 times.


Embed:

test pkgs

  1. #lang at-exp racket
  2. (require infix
  3.          plot/pict
  4.          threading)
  5.  
  6. (define (f a x) @${sin[(10+a)*x]})
  7. (define (g a x) @${x / (a+5)})
  8.  
  9. (parameterize ([line-width 2]
  10.                [plot-x-label "Degrees"]
  11.                [plot-y-label "Magnitude"]
  12.                [plot-y-ticks (linear-ticks #:number 5)]
  13.                [plot-width 800]
  14.                [plot-aspect-ratio 2]
  15.                [plot-legend-anchor 'outside-right-top])
  16.  
  17.   (plot (for/list ([a (inclusive-range 1 6)])
  18.           (function (λ~>> degrees->radians
  19.                           (f a)
  20.                           (g a))
  21.                     0 50
  22.                     #:color a
  23.                     #:label (~a "1/" (+ a 5) " sin " (+ 10 a) "x")))))

=>

datum->syntax: contract violation

  expected: (or/c #f syntax?

                     (list/c any/c

                             (or/c exact-positive-integer?

#f)

                             (or/c

exact-nonnegative-integer? #f)

                             (or/c exact-positive-integer?

#f)

                             (or/c

exact-nonnegative-integer? #f))

                     (vector/c any/c

                               (or/c exact-positive-integer?

#f)

                               (or/c

exact-nonnegative-integer? #f)

                               (or/c exact-positive-integer?

#f)

                               (or/c

exact-nonnegative-integer? #f)))

  given: '(eval 2 -1 2 1)

datum->syntax: contract violation

  expected: (or/c #f syntax?

                     (list/c any/c

                             (or/c exact-positive-integer?

#f)

                             (or/c

exact-nonnegative-integer? #f)

                             (or/c exact-positive-integer?

#f)

                             (or/c

exact-nonnegative-integer? #f))

                     (vector/c any/c

                               (or/c exact-positive-integer?

#f)

                               (or/c

exact-nonnegative-integer? #f)

                               (or/c exact-positive-integer?

#f)

                               (or/c

exact-nonnegative-integer? #f)))

  given: '(eval 3 -1 3 1)

plot: could not determine sensible plot bounds; got x ∈

[0,50], y ∈ [#f,#f]