Sorry to be picky: it isn't that it isn't available; it isn't allowed.
It is a _good_ thing that you cannot mutate an immutable set, just
like it is a good thing that (begin (set! 3 4) (+ 3 3)) doesn't
evaluate to 8.

What about trying to follow with a message like this one:

-> (hash-set! (hash) 'x 1)
; hash-set!: contract violation
;   expected: (and/c hash? (not/c immutable?))
;   given: '#hash()
;   argument position: 1st

Robby

On Fri, May 1, 2015 at 3:48 PM,  <[email protected]> wrote:
> stchang has updated `master' from 606a946212 to aef101fd84.
>   http://git.racket-lang.org/plt/606a946212..aef101fd84
>
> =====[ One Commit ]=====================================================
> Directory summary:
>  100.0% racket/collects/racket/private/
>
> ~~~~~~~~~~
>
> aef101f Stephen Chang <[email protected]> 2015-05-01 16:43
> :
> | hashset unavailable method err msg: don't say unimplemented
> :
>   M racket/collects/racket/private/set-types.rkt | 8 ++++----
>
> =====[ Overall Diff ]===================================================
>
> racket/collects/racket/private/set-types.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --- OLD/racket/collects/racket/private/set-types.rkt
> +++ NEW/racket/collects/racket/private/set-types.rkt
> @@ -459,13 +459,13 @@
>  (define custom-set-constant
>    (equal-hash-code "hash code for a set based on a hash table"))
>
> -(define (((mk-not-impl struct-descrip) method-name) s . args)
> +(define (((mk-not-impl meth-descrip struct-descrip) method-name) s . args)
>    (raise
>     (exn:fail:support
> -    (format "~a: method not implemented for ~a ~e" method-name 
> struct-descrip s)
> +    (format "~a: ~a operation not available for ~a: ~e" method-name 
> meth-descrip struct-descrip s)
>      (current-continuation-marks))))
> -(define mk-not-impl/immut (mk-not-impl "immutable set"))
> -(define mk-not-impl/mut (mk-not-impl "mutable set"))
> +(define mk-not-impl/immut (mk-not-impl "mutation" "immutable set"))
> +(define mk-not-impl/mut (mk-not-impl "non-mutation" "mutable set"))
>
>  (serializable-struct immutable-custom-set custom-set []
>    #:methods gen:stream

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAL3TdOM7fPgfmPbKXjm%2B-7m5pL5uamA%3DVNb70aYOkAfr-G_J3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to