commit 8927b67dcd57781a96f2399e5afb276b5db7b295
parent 0bdb59a7c29aa9a9d20e5c458b9d782406730e74
Author: Ryan Culpepper <ryanc@racket-lang.org>
Date: Thu, 19 Nov 2009 08:29:57 +0000
unstable: more docs, a few changes to gui libs
svn: r16887
original commit: 50bfe1b8be5f548f3fca0ff99839b20fdc046315
Diffstat:
9 files changed, 74 insertions(+), 114 deletions(-)
diff --git a/collects/macro-debugger/syntax-browser/controller.ss b/collects/macro-debugger/syntax-browser/controller.ss
@@ -28,8 +28,8 @@
(define selection-manager-mixin
(mixin (displays-manager<%>) (selection-manager<%>)
(inherit-field displays)
- (field/notify selected-syntax (new notify-box% (value #f)))
-
+ (define-notify selected-syntax (new notify-box% (value #f)))
+
(super-new)
(listen-selected-syntax
(lambda (new-value)
@@ -54,8 +54,8 @@
(define secondary-partition-mixin
(mixin (displays-manager<%>) (secondary-partition<%>)
(inherit-field displays)
- (field/notify identifier=? (new notify-box% (value #f)))
- (field/notify secondary-partition (new notify-box% (value #f)))
+ (define-notify identifier=? (new notify-box% (value #f)))
+ (define-notify secondary-partition (new notify-box% (value #f)))
(listen-identifier=?
(lambda (name+proc)
diff --git a/collects/macro-debugger/syntax-browser/prefs.ss b/collects/macro-debugger/syntax-browser/prefs.ss
@@ -1,4 +1,3 @@
-
#lang scheme/base
(require scheme/class
framework/framework
@@ -15,22 +14,22 @@
(preferences:set-default 'SyntaxBrowser:PropertiesPanelPercentage 1/3 number?)
(preferences:set-default 'SyntaxBrowser:PropertiesPanelShown #t boolean?)
-(pref:get/set pref:width SyntaxBrowser:Width)
-(pref:get/set pref:height SyntaxBrowser:Height)
-(pref:get/set pref:props-percentage SyntaxBrowser:PropertiesPanelPercentage)
-(pref:get/set pref:props-shown? SyntaxBrowser:PropertiesPanelShown)
+(define pref:width (pref:get/set 'SyntaxBrowser:Width))
+(define pref:height (pref:get/set 'SyntaxBrowser:Height))
+(define pref:props-percentage (pref:get/set 'SyntaxBrowser:PropertiesPanelPercentage))
+(define pref:props-shown? (pref:get/set 'SyntaxBrowser:PropertiesPanelShown))
(define prefs-base%
(class object%
;; suffix-option : SuffixOption
- (field/notify suffix-option (new notify-box% (value 'over-limit)))
+ (define-notify suffix-option (new notify-box% (value 'over-limit)))
;; syntax-font-size : number/#f
;; When non-false, overrides the default font size
- (field/notify syntax-font-size (new notify-box% (value #f)))
+ (define-notify syntax-font-size (new notify-box% (value #f)))
;; colors : (listof string)
- (field/notify colors
+ (define-notify colors
(new notify-box%
(value '("black" "red" "blue"
"mediumforestgreen" "darkgreen"
@@ -43,29 +42,23 @@
(define syntax-prefs-base%
(class* prefs-base% (config<%>)
- ;; width, height : number
- (notify-methods width)
- (notify-methods height)
+ (init readonly?)
+
+ (define-syntax-rule (define-pref-notify* (name pref) ...)
+ (begin (define-notify name (notify-box/pref pref #:readonly? readonly?)) ...))
- ;; props-percentage : ...
- (notify-methods props-percentage)
+ (define-pref-notify*
+ (width pref:width)
+ (height pref:height)
+ (props-percentage pref:props-percentage)
+ (props-shown? pref:props-shown?))
- ;; props-shown? : boolean
- (notify-methods props-shown?)
(super-new)))
(define syntax-prefs%
(class syntax-prefs-base%
- (connect-to-pref width pref:width)
- (connect-to-pref height pref:height)
- (connect-to-pref props-percentage pref:props-percentage)
- (connect-to-pref props-shown? pref:props-shown?)
- (super-new)))
+ (super-new (readonly? #f))))
(define syntax-prefs/readonly%
(class syntax-prefs-base%
- (connect-to-pref/readonly width pref:width)
- (connect-to-pref/readonly height pref:height)
- (connect-to-pref/readonly props-percentage pref:props-percentage)
- (connect-to-pref/readonly props-shown? pref:props-shown?)
- (super-new)))
+ (super-new (readonly? #t))))
diff --git a/collects/macro-debugger/syntax-browser/syntax-snip.ss b/collects/macro-debugger/syntax-browser/syntax-snip.ss
@@ -19,14 +19,9 @@
(provide syntax-snip%
syntax-value-snip%)
-(define syntax-snip-config-base%
- (class prefs-base%
- (notify-methods props-shown?)
- (super-new)))
-
(define syntax-snip-config%
- (class syntax-snip-config-base%
- (define/override (init-props-shown?) (new notify-box% (value #f)))
+ (class prefs-base%
+ (define-notify props-shown? (new notify-box% (value #f)))
(super-new)))
;; syntax-value-snip%
diff --git a/collects/macro-debugger/syntax-browser/text.ss b/collects/macro-debugger/syntax-browser/text.ss
@@ -108,7 +108,7 @@
(define text:hover-identifier-mixin
(mixin (text:hover<%>) (text:hover-identifier<%>)
- (field/notify hovered-identifier (new notify-box% (value #f)))
+ (define-notify hovered-identifier (new notify-box% (value #f)))
(define idlocs null)
diff --git a/collects/macro-debugger/view/frame.ss b/collects/macro-debugger/view/frame.ss
@@ -212,17 +212,16 @@
"One term at a time"
(get-field one-by-one? config))
(menu-option/notify-box extras-menu
- "Suppress warnings"
- (get-field suppress-warnings? config))
- (menu-option/notify-box extras-menu
"Extra navigation"
(get-field extra-navigation? config))
+ #|
(menu-option/notify-box extras-menu
- "Force block->letrec transformation"
- (get-field force-letrec-transformation? config))
+ "Suppress warnings"
+ (get-field suppress-warnings? config))
(menu-option/notify-box extras-menu
"(Debug) Catch internal errors?"
- (get-field debug-catch-errors? config)))
+ (get-field debug-catch-errors? config))
+ |#)
;; fixup-menu : menu -> void
;; Delete separators at beginning/end and duplicates in middle
diff --git a/collects/macro-debugger/view/interfaces.ss b/collects/macro-debugger/view/interfaces.ss
@@ -14,7 +14,6 @@
one-by-one?
extra-navigation?
debug-catch-errors?
- force-letrec-transformation?
split-context?)))
(define-interface widget<%> ()
diff --git a/collects/macro-debugger/view/prefs.ss b/collects/macro-debugger/view/prefs.ss
@@ -1,4 +1,3 @@
-
#lang scheme/base
(require scheme/class
framework/framework
@@ -16,7 +15,6 @@
(preferences:set-default 'MacroStepper:PropertiesShown? #f boolean?)
(preferences:set-default 'MacroStepper:PropertiesPanelPercentage 1/3 number?)
(preferences:set-default 'MacroStepper:MacroHidingMode "Standard" string?)
-(preferences:set-default 'MacroStepper:ShowSyntaxProperties? #f boolean?)
(preferences:set-default 'MacroStepper:ShowHidingPanel? #t boolean?)
(preferences:set-default 'MacroStepper:IdentifierComparison "bound-identifier=?" string?)
(preferences:set-default 'MacroStepper:HighlightFoci? #t boolean?)
@@ -26,82 +24,57 @@
(preferences:set-default 'MacroStepper:OneByOne? #f boolean?)
(preferences:set-default 'MacroStepper:ExtraNavigation? #f boolean?)
(preferences:set-default 'MacroStepper:DebugCatchErrors? #t boolean?)
-(preferences:set-default 'MacroStepper:ForceLetrecTransformation? #f boolean?)
(preferences:set-default 'MacroStepper:SplitContext? #f boolean?)
-
(preferences:set-default 'MacroStepper:MacroStepLimit 40000
(lambda (x) (or (eq? x #f) (exact-positive-integer? x))))
-(pref:get/set pref:width MacroStepper:Frame:Width)
-(pref:get/set pref:height MacroStepper:Frame:Height)
-(pref:get/set pref:props-shown? MacroStepper:PropertiesShown?)
-(pref:get/set pref:props-percentage MacroStepper:PropertiesPanelPercentage)
-(pref:get/set pref:macro-hiding-mode MacroStepper:MacroHidingMode)
-(pref:get/set pref:show-hiding-panel? MacroStepper:ShowHidingPanel?)
-(pref:get/set pref:identifier=? MacroStepper:IdentifierComparison)
-(pref:get/set pref:highlight-foci? MacroStepper:HighlightFoci?)
-(pref:get/set pref:highlight-frontier? MacroStepper:HighlightFrontier?)
-(pref:get/set pref:show-rename-steps? MacroStepper:ShowRenameSteps?)
-(pref:get/set pref:suppress-warnings? MacroStepper:SuppressWarnings?)
-(pref:get/set pref:one-by-one? MacroStepper:OneByOne?)
-(pref:get/set pref:extra-navigation? MacroStepper:ExtraNavigation?)
-(pref:get/set pref:debug-catch-errors? MacroStepper:DebugCatchErrors?)
-(pref:get/set pref:force-letrec-transformation? MacroStepper:ForceLetrecTransformation?)
-(pref:get/set pref:split-context? MacroStepper:SplitContext?)
+(define pref:width (pref:get/set 'MacroStepper:Frame:Width))
+(define pref:height (pref:get/set 'MacroStepper:Frame:Height))
+(define pref:props-shown? (pref:get/set 'MacroStepper:PropertiesShown?))
+(define pref:props-percentage (pref:get/set 'MacroStepper:PropertiesPanelPercentage))
+(define pref:macro-hiding-mode (pref:get/set 'MacroStepper:MacroHidingMode))
+(define pref:show-hiding-panel? (pref:get/set 'MacroStepper:ShowHidingPanel?))
+(define pref:identifier=? (pref:get/set 'MacroStepper:IdentifierComparison))
+(define pref:highlight-foci? (pref:get/set 'MacroStepper:HighlightFoci?))
+(define pref:highlight-frontier? (pref:get/set 'MacroStepper:HighlightFrontier?))
+(define pref:show-rename-steps? (pref:get/set 'MacroStepper:ShowRenameSteps?))
+(define pref:suppress-warnings? (pref:get/set 'MacroStepper:SuppressWarnings?))
+(define pref:one-by-one? (pref:get/set 'MacroStepper:OneByOne?))
+(define pref:extra-navigation? (pref:get/set 'MacroStepper:ExtraNavigation?))
+(define pref:debug-catch-errors? (pref:get/set 'MacroStepper:DebugCatchErrors?))
+(define pref:split-context? (pref:get/set 'MacroStepper:SplitContext?))
+(define pref:macro-step-limit (pref:get/set 'MacroStepper:MacroStepLimit))
-(pref:get/set pref:macro-step-limit MacroStepper:MacroStepLimit)
(define macro-stepper-config-base%
- (class* syntax-prefs-base% (config<%>)
- (notify-methods macro-hiding-mode)
- (notify-methods show-hiding-panel?)
- (notify-methods identifier=?)
- (notify-methods highlight-foci?)
- (notify-methods highlight-frontier?)
- (notify-methods show-rename-steps?)
- (notify-methods suppress-warnings?)
- (notify-methods one-by-one?)
- (notify-methods extra-navigation?)
- (notify-methods debug-catch-errors?)
- (notify-methods force-letrec-transformation?)
- (notify-methods split-context?)
+ (class* prefs-base% (config<%>)
+ (init-field readonly?)
+
+ (define-syntax-rule (define-pref-notify* (name pref) ...)
+ (begin (define-notify name (notify-box/pref pref #:readonly? readonly?)) ...))
+
+ (define-pref-notify*
+ (width pref:width)
+ (height pref:height)
+ (props-percentage pref:props-percentage)
+ (props-shown? pref:props-shown?)
+ (macro-hiding-mode pref:macro-hiding-mode)
+ (show-hiding-panel? pref:show-hiding-panel?)
+ (identifier=? pref:identifier=?)
+ (highlight-foci? pref:highlight-foci?)
+ (highlight-frontier? pref:highlight-frontier?)
+ (show-rename-steps? pref:show-rename-steps?)
+ (suppress-warnings? pref:suppress-warnings?)
+ (one-by-one? pref:one-by-one?)
+ (extra-navigation? pref:extra-navigation?)
+ (debug-catch-errors? pref:debug-catch-errors?)
+ (split-context? pref:split-context?))
(super-new)))
(define macro-stepper-config/prefs%
(class macro-stepper-config-base%
- (connect-to-pref width pref:width)
- (connect-to-pref height pref:height)
- (connect-to-pref props-percentage pref:props-percentage)
- (connect-to-pref props-shown? pref:props-shown?)
- (connect-to-pref macro-hiding-mode pref:macro-hiding-mode)
- (connect-to-pref show-hiding-panel? pref:show-hiding-panel?)
- (connect-to-pref identifier=? pref:identifier=?)
- (connect-to-pref highlight-foci? pref:highlight-foci?)
- (connect-to-pref highlight-frontier? pref:highlight-frontier?)
- (connect-to-pref show-rename-steps? pref:show-rename-steps?)
- (connect-to-pref suppress-warnings? pref:suppress-warnings?)
- (connect-to-pref one-by-one? pref:one-by-one?)
- (connect-to-pref extra-navigation? pref:extra-navigation?)
- (connect-to-pref debug-catch-errors? pref:debug-catch-errors?)
- (connect-to-pref force-letrec-transformation? pref:force-letrec-transformation?)
- (connect-to-pref split-context? pref:split-context?)
- (super-new)))
+ (super-new (readonly? #f))))
(define macro-stepper-config/prefs/readonly%
(class macro-stepper-config-base%
- (connect-to-pref/readonly width pref:width)
- (connect-to-pref/readonly height pref:height)
- (connect-to-pref/readonly macro-hiding-mode pref:macro-hiding-mode)
- (connect-to-pref/readonly props-percentage pref:props-percentage)
- (connect-to-pref/readonly show-hiding-panel? pref:show-hiding-panel?)
- (connect-to-pref/readonly identifier=? pref:identifier=?)
- (connect-to-pref/readonly highlight-foci? pref:highlight-foci?)
- (connect-to-pref/readonly highlight-frontier? pref:highlight-frontier?)
- (connect-to-pref/readonly show-rename-steps? pref:show-rename-steps?)
- (connect-to-pref/readonly suppress-warnings? pref:suppress-warnings?)
- (connect-to-pref/readonly one-by-one? pref:one-by-one?)
- (connect-to-pref/readonly extra-navigation? pref:extra-navigation?)
- (connect-to-pref/readonly debug-catch-errors? pref:debug-catch-errors?)
- (connect-to-pref/readonly force-letrec-transformation? pref:force-letrec-transformation?)
- (connect-to-pref/readonly split-context? pref:split-context?)
- (super-new)))
+ (super-new (readonly? #t))))
diff --git a/collects/macro-debugger/view/stepper.ss b/collects/macro-debugger/view/stepper.ss
@@ -54,7 +54,7 @@
(cursor:next terms))
;; current-step-index : notify of number/#f
- (field/notify current-step-index (new notify-box% (value #f)))
+ (define-notify current-step-index (new notify-box% (value #f)))
;; add-deriv : Deriv -> void
(define/public (add-deriv d)
@@ -166,8 +166,6 @@
(lambda (_) (refresh/re-reduce)))
(listen-one-by-one?
(lambda (_) (refresh/re-reduce)))
- (listen-force-letrec-transformation?
- (lambda (_) (refresh/resynth)))
(listen-extra-navigation?
(lambda (show?) (show-extra-navigation show?))))
diff --git a/collects/unstable/scribblings/find.scrbl b/collects/unstable/scribblings/find.scrbl
@@ -1,5 +1,6 @@
#lang scribble/manual
@(require scribble/eval
+ "utils.ss"
(for-label unstable/find
scheme/contract
scheme/shared
@@ -13,6 +14,8 @@
@defmodule[unstable/find]
+@unstable[@author+email["Ryan Culpepper" "ryanc@plt-scheme.org"]]
+
@defproc[(find [pred (-> any/c any/c)]
[x any/c]
[#:stop-on-found? stop-on-found? any/c #f]