Thanks again.
I've tweaked and commented the end of Mathias's example:
(module+ test
(check-exn exn:fail:contract? (lambda () (f 1))) ; violates contract by
returning non-integer
(check-exn exn:fail:contract? (lambda () (f 'a ; violates contract by
being called with a non-integer
and
Beautiful! Thanks to both of you. Can't wait to try it out.
Cheers,
Tim
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com
Hers is what Sam means with an example:
#lang racket
(module+ test
(require rackunit))
;; --- in file
(module server racket
(provide
(contract-out
(f (-> integer? integer?
(define (f x)
(if (= x 1) "hello world" x)))
;; --- in text client
(require 'server)
(module+ te
The second argument to check-exn needs to be a thunk.
Sam
On Nov 18, 2017 7:32 AM, "Tim Hanson" wrote:
> Hi, I guess this didn't find the right subject matter expert yet. Would it
> be better to ask a specific person or use a different channel?
> Cheers, tbh
>
> --
> You received this message b
Hi, I guess this didn't find the right subject matter expert yet. Would it be
better to ask a specific person or use a different channel?
Cheers, tbh
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiv
hi,
As part of something I'm working on I want to convert a stream of values
into a stream of pairs of values, e.g.
1 2 3 4
becomes
(1 2) (3 4)
The following seems to work fine:
(define (pairwise-stream astream)
(if (stream-empty? astream)
empty-stream
(stream-cons
(c
6 matches
Mail list logo