From 0da1c82584526242242db0cb3a9ffb43325eb0dd Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Thu, 12 Jul 2012 19:29:13 -0400 Subject: [PATCH] Changing contracts on gl-context<%> and applying it to the gl-context% object. I updated and noticed that this was now failing because interface contracts are not check structurally (any more?). Once I applied the interface, the contract application failed because the documented two additional arguments (alternative and enable-breaks?) are not actually accepted. I look through all the implementations of gl-context% and none of them accept these. Should I change the documentation or is this a bad backwards incompatibility with the older versions? --- collects/racket/draw/private/gl-context.rkt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/collects/racket/draw/private/gl-context.rkt b/collects/racket/draw/private/gl-context.rkt index 749f5e86e1..1c54ee6baa 100644 --- a/collects/racket/draw/private/gl-context.rkt +++ b/collects/racket/draw/private/gl-context.rkt @@ -36,9 +36,15 @@ (lambda (v) (loop)))))) (define manager-t (thread/suspend-to-kill lock-manager)) +(define gl-context<%> + (interface () + [call-as-current (->*m [(-> any)] any)] + [ok? (->m boolean?)] + [swap-buffers (->m any)])) + ;; Implemented by subclasses: (define gl-context% - (class object% + (class* object% (gl-context<%>) (define/private (with-gl-lock t) (thread-resume manager-t (current-thread)) (if (eq? (current-thread) (channel-get lock-holder-ch)) @@ -67,9 +73,3 @@ (define/public (do-swap-buffers t) (void)) (super-new))) - -(define gl-context<%> - (interface () - [call-as-current (->*m [(-> any)] [evt? any/c] any)] - [ok? (->m boolean?)] - [swap-buffers (->m any)]))