updated many unions to or/c's

svn: r2061
This commit is contained in:
Robby Findler 2006-01-31 19:17:33 +00:00
parent c43a6f2821
commit fddb1fa862
23 changed files with 175 additions and 180 deletions

View File

@ -16,7 +16,7 @@
(opt-> (path-string?
any/c
any/c
(listof (list/c (union boolean? symbol?) any/c))
(listof (list/c (or/c boolean? symbol?) any/c))
(listof path-string?)
any/c
(listof string?))

View File

@ -1203,7 +1203,7 @@
(port? (list/c (and/c number? integer? exact? (>=/c 0))
(and/c number? integer? exact? (>=/c 0))
(and/c number? integer? exact? (>=/c 0))))
(union syntax? eof-object?))
(or/c syntax? eof-object?))
(dynamic-require reader-spec 'read-syntax)
(string->symbol (format "~s" lang-position))
'drscheme))

View File

@ -473,7 +473,7 @@
;; in the beginning of the editor
;; or #f if the beginning doesn't match "(module "
(define/contract get-module-filename
(-> (union false/c string?))
(-> (or/c false/c string?))
(λ ()
(let ([open-paren (skip-whitespace 0)])
(or (match-paren open-paren "(")
@ -481,7 +481,7 @@
(match-paren open-paren "{")))))
(define/contract match-paren
(number? string? . -> . (union false/c string?))
(number? string? . -> . (or/c false/c string?))
(λ (open-paren paren)
(and (matches open-paren paren)
(let ([module (skip-whitespace (+ open-paren 1))])

View File

@ -63,12 +63,12 @@
"Returns a list of all of the snipclasses in the current eventspace")
(drscheme:eval:expand-program
((union port? drscheme:language:text/pos?)
((or/c port? drscheme:language:text/pos?)
drscheme:language-configuration:language-settings?
boolean?
(-> void?)
(-> void?)
((union eof-object? syntax? (cons/c string? any/c))
((or/c eof-object? syntax? (cons/c string? any/c))
(-> any)
. -> .
any)
@ -131,8 +131,8 @@
(-> void?)
(-> void?)
. -> .
((union port? drscheme:language:text/pos?)
((union eof-object? syntax? (cons/c string? any/c))
((or/c port? drscheme:language:text/pos?)
((or/c eof-object? syntax? (cons/c string? any/c))
(-> any)
. -> .
any)
@ -154,8 +154,8 @@
(-> void?)
(-> void?)
. -> .
((union port? drscheme:language:text/pos?)
((union eof-object? syntax? (cons/c string? any/c))
((or/c port? drscheme:language:text/pos?)
((or/c eof-object? syntax? (cons/c string? any/c))
(-> any)
. -> .
any)
@ -258,8 +258,8 @@
(drscheme:debug:show-error-and-highlight
(string?
(union any/c exn?)
(-> (listof srcloc?) (union false/c (listof (list/c (is-a?/c text%) number? number?))) any)
(or/c any/c exn?)
(-> (listof srcloc?) (or/c false/c (listof (list/c (is-a?/c text%) number? number?))) any)
. -> .
any)
(msg exn highlight-errors)
@ -271,9 +271,9 @@
"This function should be called on the same thread/eventspace where the error happened.")
(drscheme:debug:make-debug-error-display-handler
((string? (union any/c exn?) . -> . any)
((string? (or/c any/c exn?) . -> . any)
. -> .
(string? (union any/c exn?) . -> . any))
(string? (or/c any/c exn?) . -> . any))
(oedh)
@ -419,7 +419,7 @@
(drscheme:unit:open-drscheme-window
(case->
(-> (is-a?/c drscheme:unit:frame%))
((union string? false/c) . -> . (is-a?/c drscheme:unit:frame%)))
((or/c string? false/c) . -> . (is-a?/c drscheme:unit:frame%)))
(() (filename))
"Opens a drscheme frame that displays \\var{filename},"
@ -447,9 +447,9 @@
(drscheme:modes:add-mode
(string?
(union false/c (is-a?/c mode:surrogate-text<%>))
(or/c false/c (is-a?/c mode:surrogate-text<%>))
((is-a?/c drscheme:rep:text%) number? . -> . boolean?)
((union false/c (listof string?)) . -> . boolean?)
((or/c false/c (listof string?)) . -> . boolean?)
. -> .
drscheme:modes:mode?)
(name surrogate repl-submit matches-language)
@ -517,7 +517,7 @@
".")
(drscheme:modes:mode-surrogate
(drscheme:modes:mode? . -> . (union false/c (is-a?/c mode:surrogate-text<%>)))
(drscheme:modes:mode? . -> . (or/c false/c (is-a?/c mode:surrogate-text<%>)))
(mode)
"Extracts the surrogate of the mode."
""
@ -535,7 +535,7 @@
".")
(drscheme:modes:mode-matches-language
(drscheme:modes:mode? . -> . ((union false/c (listof string?)) . -> . boolean?))
(drscheme:modes:mode? . -> . ((or/c false/c (listof string?)) . -> . boolean?))
(mode)
"Extracts the language matching predicate of the mode."
""
@ -573,7 +573,7 @@
"windows. Also binds f5 to Execute and f1 to Help Desk.")
(drscheme:rep:current-rep
(-> (union false/c (is-a?/c drscheme:rep:text%)))
(-> (or/c false/c (is-a?/c drscheme:rep:text%)))
()
"This is a parameter whose value should not be set by tools."
@ -584,7 +584,7 @@
"in the context of a repl (eg, the test suite window).")
(drscheme:rep:current-value-port
(-> (union false/c port?))
(-> (or/c false/c port?))
()
"This is a parameter whose value is a port that"
"prints in the REPL in blue. It is used to print"
@ -785,7 +785,7 @@
".")
(drscheme:language-configuration:make-language-settings
((union (is-a?/c drscheme:language:language<%>) language-object)
((or/c (is-a?/c drscheme:language:language<%>) language-object)
any/c
. -> .
drscheme:language-configuration:language-settings?)
@ -814,7 +814,7 @@
(drscheme:language-configuration:language-settings-language
(drscheme:language-configuration:language-settings?
. -> .
(union (is-a?/c drscheme:language:language<%>) language-object))
(or/c (is-a?/c drscheme:language:language<%>) language-object))
(ls)
"Extracts the language field of a language-settings.")
@ -828,9 +828,9 @@
(drscheme:language-configuration:language-dialog
(opt->
(boolean? drscheme:language-configuration:language-settings?)
((union false/c (is-a?/c top-level-window<%>))
((or/c false/c (is-a?/c top-level-window<%>))
boolean?)
(union false/c drscheme:language-configuration:language-settings?))
(or/c false/c drscheme:language-configuration:language-settings?))
((show-welcome? language-settings-to-show)
((parent #t)
(manuals? #f)))
@ -867,7 +867,7 @@
((is-a?/c vertical-panel%)
(is-a?/c area-container<%>)
drscheme:language-configuration:language-settings?)
((union false/c (is-a?/c top-level-window<%>))
((or/c false/c (is-a?/c top-level-window<%>))
boolean?)
drscheme:language-configuration:language-settings?)
((panel button-panel language-setting)
@ -970,7 +970,7 @@
".")
(drscheme:language:put-executable
((is-a?/c top-level-window<%>) path? boolean? boolean? string? . -> . (union false/c path?))
((is-a?/c top-level-window<%>) path? boolean? boolean? string? . -> . (or/c false/c path?))
(parent program-filename mred? launcher? title)
"Calls the MrEd primitive"
"@flink put-file"
@ -989,12 +989,12 @@
"primitive.")
(drscheme:language:create-executable-gui
((union false/c (is-a?/c top-level-window<%>))
(union false/c string?)
(union (λ (x) (eq? x #t)) (symbols 'launcher 'standalone))
(union (λ (x) (eq? x #t)) (symbols 'mzscheme 'mred))
((or/c false/c (is-a?/c top-level-window<%>))
(or/c false/c string?)
(or/c (λ (x) (eq? x #t)) (symbols 'launcher 'standalone))
(or/c (λ (x) (eq? x #t)) (symbols 'mzscheme 'mred))
. -> .
(union false/c
(or/c false/c
(list/c (symbols 'no-show 'launcher 'stand-alone)
(symbols 'no-show 'mred 'mzscheme)
string?)))
@ -1017,8 +1017,8 @@
"otherwise it will indicate the user's choice.")
(drscheme:language:create-module-based-stand-alone-executable
((union path? string?)
(union path? string?) any/c any/c any/c boolean? boolean?
((or/c path? string?)
(or/c path? string?) any/c any/c any/c boolean? boolean?
. -> .
void?)
(program-filename
@ -1055,7 +1055,7 @@
"\\rawscm{namespace-require}. ")
(drscheme:language:create-module-based-launcher
((union path? string?) (union path? string?) any/c any/c any/c boolean? boolean?
((or/c path? string?) (or/c path? string?) any/c any/c any/c boolean? boolean?
. -> .
void?)
(program-filename
@ -1305,7 +1305,7 @@
. -> .
(case-> (any/c . -> . void?) (-> any/c))))
(create-executable (any/c
(union (is-a?/c dialog%) (is-a?/c frame%))
(or/c (is-a?/c dialog%) (is-a?/c frame%))
path?
drscheme:teachpack:teachpack-cache?
. -> .
@ -1326,10 +1326,10 @@
(get-language-name (-> string?))
(get-language-numbers (-> (cons/c number? (listof number?))))
(get-language-position (-> (cons/c string? (listof string?))))
(get-language-url (-> (union false/c string?)))
(get-language-url (-> (or/c false/c string?)))
(get-one-line-summary (-> string?))
(get-comment-character (-> (values string? char?)))
(get-style-delta (-> (union false/c
(get-style-delta (-> (or/c false/c
(is-a?/c style-delta%)
(listof (list/c (is-a?/c style-delta%) number? number?)))))
(marshall-settings (any/c . -> . printable/c))

View File

@ -228,7 +228,7 @@
"default preferences.")
(preferences:add-panel
((union string? (cons/c string? (listof string?)))
((or/c string? (cons/c string? (listof string?)))
((is-a?/c area-container-window<%>)
. ->d .
(λ (parent)
@ -494,13 +494,13 @@
(opt->
()
(string?
(union false/c path?)
(or/c false/c path?)
boolean?
string?
(union false/c byte-regexp?)
(or/c false/c byte-regexp?)
string?
(union (is-a?/c top-level-window<%>) false/c))
(union false/c path?))
(or/c (is-a?/c top-level-window<%>) false/c))
(or/c false/c path?))
(()
((name "Untitled")
(directory #f)
@ -518,12 +518,12 @@
(finder:common-get-file
(opt->
()
((union path? false/c)
((or/c path? false/c)
string?
(union byte-regexp? false/c)
(or/c byte-regexp? false/c)
string?
(union false/c (is-a?/c top-level-window<%>)))
(union path? false/c))
(or/c false/c (is-a?/c top-level-window<%>)))
(or/c path? false/c))
(()
((directory #f)
(prompt "Select File")
@ -540,13 +540,13 @@
(opt->
()
(string?
(union false/c path?)
(or/c false/c path?)
boolean?
string?
(union false/c byte-regexp?)
(or/c false/c byte-regexp?)
string?
(union (is-a?/c top-level-window<%>) false/c))
(union false/c path?))
(or/c (is-a?/c top-level-window<%>) false/c))
(or/c false/c path?))
(()
((name "Untitled")
(directory #f)
@ -564,12 +564,12 @@
(finder:std-get-file
(opt->
()
((union path? false/c)
((or/c path? false/c)
string?
(union byte-regexp? false/c)
(or/c byte-regexp? false/c)
string?
(union false/c (is-a?/c top-level-window<%>)))
(union path? false/c))
(or/c false/c (is-a?/c top-level-window<%>)))
(or/c path? false/c))
(()
((directory #f)
(prompt "Select File")
@ -586,13 +586,13 @@
(opt->
()
(string?
(union false/c path?)
(or/c false/c path?)
boolean?
string?
(union false/c byte-regexp?)
(or/c false/c byte-regexp?)
string?
(union (is-a?/c top-level-window<%>) false/c))
(union false/c path?))
(or/c (is-a?/c top-level-window<%>) false/c))
(or/c false/c path?))
(()
((name "Untitled")
(directory #f)
@ -614,12 +614,12 @@
(finder:get-file
(opt->
()
((union path? false/c)
((or/c path? false/c)
string?
(union byte-regexp? string? false/c)
(or/c byte-regexp? string? false/c)
string?
(union false/c (is-a?/c top-level-window<%>)))
(union path? false/c))
(or/c false/c (is-a?/c top-level-window<%>)))
(or/c path? false/c))
(()
((directory #f)
(prompt "Select File")
@ -639,12 +639,12 @@
(finder:common-get-file-list
(opt->
()
((union false/c path?)
((or/c false/c path?)
string?
(union false/c byte-regexp?)
(or/c false/c byte-regexp?)
string?
(union false/c (is-a?/c top-level-window<%>)))
(union (listof path?) false/c))
(or/c false/c (is-a?/c top-level-window<%>)))
(or/c (listof path?) false/c))
(()
((directory #f)
(prompt "Select File")
@ -699,7 +699,7 @@
(handler)
"Extracts the name from a handler.")
(handler:handler-extension
(handler:handler? . -> . (union (path? . -> . boolean?) (listof string?)))
(handler:handler? . -> . (or/c (path? . -> . boolean?) (listof string?)))
(handler)
"Extracts the extension from a handler.")
(handler:handler-handler
@ -708,8 +708,8 @@
"Extracs the handler's handling function")
(handler:insert-format-handler
(string?
(union string? (listof string?) (path? . -> . boolean?))
(path? . -> . (union false/c (is-a?/c frame:editor<%>)))
(or/c string? (listof string?) (path? . -> . boolean?))
(path? . -> . (or/c false/c (is-a?/c frame:editor<%>)))
. -> .
void?)
(name pred handler)
@ -744,9 +744,9 @@
(handler:edit-file
(opt->
((union path? false/c))
((or/c path? false/c))
((-> (is-a?/c frame:editor<%>)))
(union false/c (is-a?/c frame:editor<%>)))
(or/c false/c (is-a?/c frame:editor<%>)))
((filename)
((make-default (λ () ((handler:current-create-new-window) filename)))))
"This function creates a frame or re-uses an existing frame to edit a file. "
@ -790,8 +790,8 @@
(handler:current-create-new-window
(case->
(((union false/c path?) . -> . (is-a?/c frame%)) . -> . void)
(-> ((union false/c string?) . -> . (is-a?/c frame%))))
(((or/c false/c path?) . -> . (is-a?/c frame%)) . -> . void)
(-> ((or/c false/c string?) . -> . (is-a?/c frame%))))
((new-window-handler) ())
"This is a parameter that controls how the framework"
"creates new application windows."
@ -805,7 +805,7 @@
"\\end{schemedisplay}")
(handler:open-file
(-> (union false/c (is-a?/c frame:basic<%>)))
(-> (or/c false/c (is-a?/c frame:basic<%>)))
()
"This function queries the user for a filename and opens the file for"
"editing. It uses "
@ -1298,7 +1298,7 @@
(scheme:text-balanced?
(opt->
((is-a?/c text%))
(number? (union false/c number?))
(number? (or/c false/c number?))
boolean?)
((text)
((start 0) (end #f)))
@ -1516,7 +1516,7 @@
"Builds a printed representation for a style-delta.")
(color-prefs:unmarshall-style
(-> printable/c (union false/c (is-a?/c style-delta%)))
(-> printable/c (or/c false/c (is-a?/c style-delta%)))
(marshalled-style-delta)
"Builds a style delta from its printed representation."
"Returns \\scheme|#f| if the printed form cannot be parsed.")

View File

@ -150,9 +150,9 @@
(string?
string?)
(boolean?
(union false/c
(is-a?/c frame%)
(is-a?/c dialog%)))
(or/c false/c
(is-a?/c frame%)
(is-a?/c dialog%)))
(symbols 'continue 'save 'cancel))
((filename action)
((can-save-now? #f)
@ -175,7 +175,7 @@
string?)
(string?
any/c
(union false/c (is-a?/c frame%) (is-a?/c dialog%))
(or/c false/c (is-a?/c frame%) (is-a?/c dialog%))
(symbols 'app 'caution 'stop))
any/c)
((message true-choice false-choice)

View File

@ -80,7 +80,7 @@
;; ((frame-has? p) f) =
;; f is a frame and it has a child (in it or a subpanel) that responds #t to p
(test:button-push
((union (λ (str)
((or/c (λ (str)
(and (string? str)
(test:top-level-focus-window-has?
(λ (c)
@ -104,7 +104,7 @@
"active frame. Otherwise, it pushes the button argument.")
(test:set-radio-box!
((union string? (is-a?/c radio-box%)) (union string? number?) . -> . void?)
((or/c string? (is-a?/c radio-box%)) (or/c string? number?) . -> . void?)
(radio-box state)
"Sets the radio-box to \\var{state}. If \\var{state} is a"
"string, this function finds the choice with that label and"
@ -122,7 +122,7 @@
"Finds a \\iscmclass{radio-box} that has a label \\var{entry}"
"and sets the radio-box to \\var{entry}.")
(test:set-check-box!
((union string? (is-a?/c check-box%)) boolean? . -> . void?)
((or/c string? (is-a?/c check-box%)) boolean? . -> . void?)
(check-box state)
"Clears the \\iscmclass{check-box} item if \\var{state} is \\rawscm{\\#f}, and sets it"
"otherwise."
@ -132,7 +132,7 @@
"otherwise it uses \\var{check-box} itself.")
(test:set-choice!
((union string? (is-a?/c choice%)) string? . -> . void?)
((or/c string? (is-a?/c choice%)) string? . -> . void?)
(choice str)
"Selects \\var{choice}'s item \\var{str}. If \\var{choice} is a string,"
"this function searches for a \\iscmclass{choice} with a label matching"
@ -140,7 +140,7 @@
(test:keystroke
(opt->
((union char? symbol?))
((or/c char? symbol?))
((listof (symbols 'alt 'control 'meta 'shift 'noalt 'nocontrol 'nometea 'noshift)))
void?)
((key)

View File

@ -96,7 +96,7 @@
; (type: tally-row (list-of (union 'off 'on 'unknown 'maybe-off 'maybe-on 'mixed)))
; (type: try-row (list-of (union 'maybe-off 'maybe-on 'unknown)))
(define try-row? (listof (symbols 'maybe-off 'maybe-on 'unknown)))
(define try-batch? (listof (union number? (listof try-row?))))
(define try-batch? (listof (or/c number? (listof try-row?))))
;
; (type: board (list-of board-row))

View File

@ -23,9 +23,9 @@
[finddoc-page (string? string? . -> . string?)]
[get-doc-name (path? . -> . string?)]
[find-doc-directories (-> (listof path?))]
[find-doc-directory (path? . -> . (union false/c path?))]
[find-doc-directory (path? . -> . (or/c false/c path?))]
[find-doc-names (-> (listof (cons/c path? string?)))]
[get-index-file (path? . -> . (union false/c path?))])
[get-index-file (path? . -> . (or/c false/c path?))])
(provide find-manuals)

View File

@ -20,16 +20,16 @@
(-> any)
(string? any/c . -> . void?)
(string? any/c . -> . void?)
(string? string? string? path? (union string? number? false/c) any/c . -> . void?)
(string? string? string? path? (or/c string? number? false/c) any/c . -> . void?)
. -> .
(union string? false/c))]
(or/c string? false/c))]
(build-string-finds/finds (string?
boolean?
boolean?
. -> .
(values (listof string?)
(listof (union regexp? string?)))))
(listof (or/c regexp? string?)))))
(non-regexp (string? . -> . string?)))

View File

@ -20,12 +20,12 @@
any/c
(listof path?)
any/c
(union false/c string?) . -> . string?))
(or/c false/c string?) . -> . string?))
(make-results-url (string?
search-type? search-how? any/c
(listof path?)
any/c
(union false/c string?)
(or/c false/c string?)
. -> .
string?))
(flush-manuals-url string?)

View File

@ -330,37 +330,32 @@ plt/collects/tests/mzscheme/image-test.ss
(if (<= pre-x1 pre-x2)
(values pre-x1 pre-y1 pre-x2 pre-y2)
(values pre-x2 pre-y2 pre-x1 pre-y1))])
(let* ([line-w (+ (abs (- x2 x1)) 1)]
[line-h (+ (abs (- y2 y1)) 1)])
(let* ([line-w (abs (- x2 x1))]
[line-h (abs (- y2 y1))]
[build-snip
(λ (do-draw py-offset)
(let* ([draw-proc
(make-color-wrapper color-in 'transparent 'solid do-draw)]
[mask-proc
(make-color-wrapper 'black 'transparent 'solid do-draw)]
[line
(make-simple-cache-image-snip (+ line-w 1) (+ line-h 1) px py draw-proc mask-proc)])
(real-overlay/xy 'add-line i (+ px x1) (+ py py-offset) line)))])
(if (y1 . <= . y2)
(let* ([do-draw
(lambda (dc dx dy)
(send dc draw-line
dx
dy
(+ dx (- x2 x1))
(+ dy (- y2 y1))))]
[draw-proc
(make-color-wrapper color-in 'transparent 'solid do-draw)]
[mask-proc
(make-color-wrapper 'black 'transparent 'solid do-draw)]
[line
(make-simple-cache-image-snip line-w line-h px py draw-proc mask-proc)])
(real-overlay/xy 'add-line i (+ px x1) (+ py y1) line))
(let* ([do-draw
(lambda (dc dx dy)
(send dc draw-line
dx
(+ dy (- line-h 1))
(+ dx (- line-w 1))
dy))]
[draw-proc
(make-color-wrapper color-in 'transparent 'solid do-draw)]
[mask-proc
(make-color-wrapper 'black 'transparent 'solid do-draw)]
[line
(make-simple-cache-image-snip line-w line-h px py draw-proc mask-proc)])
(real-overlay/xy 'add-line i (+ px x1) (+ py y2) line)))))))
(build-snip (λ (dc dx dy)
(send dc draw-line
dx
dy
(+ dx (- x2 x1))
(+ dy (- y2 y1))))
y1)
(build-snip (λ (dc dx dy)
(send dc draw-line
dx
(+ dy line-h)
(+ dx line-w)
dy))
y2))))))
(define (text str size color-in)
(check 'text string? str "string" "first")
@ -484,6 +479,7 @@ plt/collects/tests/mzscheme/image-test.ss
(define (make-simple-cache-image-snip w h px py dc-proc mask-proc)
(let ([w (inexact->exact (ceiling w))]
[h (inexact->exact (ceiling h))])
(printf "new w ~s new -h ~s\n" w h)
(let ([argb-proc
(lambda (argb-vector dx dy)
(let ([c-bm (build-bitmap (lambda (dc) (dc-proc dc 0 0)) w h)]

View File

@ -7,12 +7,12 @@
(provide/contract
[make-bitmap-label (opt->
(string?
(union path-string?
(or/c path-string?
(is-a?/c bitmap%)))
((is-a?/c font%))
(is-a?/c bitmap%))]
[bitmap-label-maker (string?
(union path-string?
(or/c path-string?
(is-a?/c bitmap%))
. -> .
(any/c . -> . (is-a?/c bitmap%)))])

View File

@ -34,54 +34,54 @@
void?)
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c brush%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c brush%))
. -> .
void?)
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c brush%))
(union false/c string?)
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c brush%))
(or/c false/c string?)
. -> .
void?)
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c brush%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c brush%))
number?
number?
. -> .
void?)
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c brush%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c brush%))
number?
number?
(union false/c string?)
(or/c false/c string?)
. -> .
void?)))
(add-links/text-colors
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c pen%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c brush%))
(union false/c (is-a?/c color%))
(union false/c (is-a?/c color%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c pen%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c brush%))
(or/c false/c (is-a?/c color%))
(or/c false/c (is-a?/c color%))
number?
number?
(union false/c string?)
(or/c false/c string?)
. -> .
void?)))
@ -351,7 +351,7 @@
(let* ([parents-and-children (append (get-all-parents snip)
(get-all-children snip))]
[rects (eliminate-redundancies (get-rectangles snip parents-and-children))]
[union (union-rects rects)]
[or/c (or/c-rects rects)]
[text-height (call-with-values
(λ () (send dc get-text-extent "Label" #f #f 0))
(λ (w h a s) h))]
@ -366,9 +366,9 @@
(rect-top rect))
text-height)))])
(cond
[(< (rect-area union)
[(< (rect-area or/c)
(apply + (map (lambda (x) (rect-area x)) rects)))
(invalidate-rect union)]
(invalidate-rect or/c)]
[else
(for-each invalidate-rect rects)]))))
@ -414,7 +414,7 @@
sy
(+ (+ sx sw) self-offset)
(+ (+ sy sh) self-offset h)))
(union-rects (list main-snip-rect
(or/c-rects (list main-snip-rect
(snip->rect c/p))))])
(cons rect (loop (cdr c/p-snips))))]))))
@ -432,7 +432,7 @@
(- (rect-bottom rect)
(rect-top rect))))
(define/private (union-rects rects)
(define/private (or/c-rects rects)
(cond
[(null? rects) (make-rect 0 0 0 0)]
[else
@ -928,7 +928,7 @@
(and (< (min p1x p2x) x (max p1x p2x))
(< (min p1y p2y) y (max p1y p2y))))
;; find-intersection : number^8 -> (values (union #f number) (union #f number))
;; find-intersection : number^8 -> (values (or/c #f number) (or/c #f number))
;; calculates the intersection between two line segments,
;; described as pairs of points. Returns #f if they do not intersect
(define (find-intersection x1 y1 x2 y2 x3 y3 x4 y4)
@ -975,7 +975,7 @@
(values int-x int-y)
(values #f #f)))))
;; find-mb : number number number number -> (values (union #f number) (union #f number))
;; find-mb : number number number number -> (values (or/c #f number) (or/c #f number))
;; finds the "m" and "b" constants that describe the
;; lines from (x1, y1) to (x2, y2)
(define (find-mb x1 y1 x2 y2)

View File

@ -11,7 +11,7 @@
(provide/contract
(pasteboard-root ((is-a?/c aligned-pasteboard<%>) . -> . (is-a?/c aligned-pasteboard<%>)))
(pasteboard-parent
((is-a?/c pasteboard%) . -> . (union (is-a?/c editor-canvas%) (is-a?/c editor-snip%) false/c))))
((is-a?/c pasteboard%) . -> . (or/c (is-a?/c editor-canvas%) (is-a?/c editor-snip%) false/c))))
;; gets the top most aligned pasteboard in the tree of pasteboards and containers
(define (pasteboard-root pasteboard)
@ -35,5 +35,4 @@
(send admin get-snip)]
[(is-a? admin editor-admin%)
(send pasteboard get-canvas)]
[else false])))
)
[else false]))))

View File

@ -11,7 +11,7 @@
;; a snip
(define snip? (is-a?/c snip%))
;; a snip to act as the varying argument to a recursive functions
(define linked-snip? (union snip? false/c))
(define linked-snip? (or/c snip? false/c))
;; a function to act on snips being mapped
(define snip-visitor? any/c #;((snip?) (listof any/c) . ->* . (void)))
;; the rest of the lists passed to a snip mapping function
@ -24,7 +24,7 @@
(snip-height (snip? . -> . number?))
(snip-min-width (snip? . -> . number?))
(snip-min-height (snip? . -> . number?))
(snip-parent (snip? . -> . (union editor? false/c)))
(snip-parent (snip? . -> . (or/c editor? false/c)))
(fold-snip ((snip? any/c . -> . any/c) any/c linked-snip? . -> . any/c))
(for-each-snip any/c #;((snip-visitor? linked-snip?) rest-lists? . ->* . (void)))
(map-snip any/c #;((snip-visitor? linked-snip?) rest-lists? . ->* . ((listof any/c))))

View File

@ -64,7 +64,7 @@
(peek-string-evt (exact-non-negative-integer? exact-non-negative-integer? evt?/false
input-port-with-progress-evts?
. -> . evt?))
(regexp-match-evt ((union regexp? byte-regexp? string? bytes?)
(regexp-match-evt ((or/c regexp? byte-regexp? string? bytes?)
input-port-with-progress-evts?
. -> . evt?))

View File

@ -13,8 +13,8 @@
[imap-get-hierarchy-delimiter (imap-connection? . -> . bytes?)]
[imap-list-child-mailboxes
(case->
(imap-connection? (union false/c bytes?) . -> . (listof (list/c (listof symbol?) bytes?)))
(imap-connection? (union false/c bytes?) (union false/c bytes?)
(imap-connection? (or/c false/c bytes?) . -> . (listof (list/c (listof symbol?) bytes?)))
(imap-connection? (or/c false/c bytes?) (or/c false/c bytes?)
. -> .
(listof (list/c (listof symbol?) bytes?))))])

View File

@ -5,13 +5,13 @@
(define-struct path/param (path param))
(provide/contract
(struct url ([scheme (union false/c string?)]
[user (union false/c string?)]
[host (union false/c string?)]
[port (union false/c number?)]
(struct url ([scheme (or/c false/c string?)]
[user (or/c false/c string?)]
[host (or/c false/c string?)]
[port (or/c false/c number?)]
[path-absolute? boolean?]
[path (listof path/param?)]
[query (listof (cons/c symbol? string?))]
[fragment (union false/c string?)]))
(struct path/param ([path (union string? (symbols 'up 'same))]
[fragment (or/c false/c string?)]))
(struct path/param ([path (or/c string? (symbols 'up 'same))]
[param (listof string?)]))))

View File

@ -28,12 +28,12 @@
(struct path/param (path param)))
(provide/contract
(string->url ((union bytes? string?) . -> . url?))
(string->url ((or/c bytes? string?) . -> . url?))
(url->string (url? . -> . string?))
(get-pure-port (opt-> (url?) ((listof string?)) input-port?))
(get-impure-port (opt-> (url?) ((listof string?)) input-port?))
(post-pure-port (opt-> (url? (union false/c bytes?)) ((listof string?)) input-port?))
(post-pure-port (opt-> (url? (or/c false/c bytes?)) ((listof string?)) input-port?))
(post-impure-port (opt-> (url? bytes?) ((listof string?)) input-port?))
(display-pure-port (input-port? . -> . void?))
(purify-port (input-port? . -> . string?))
@ -46,6 +46,6 @@
(combine-url/relative (url? string? . -> . url?))
(url-exception? (any/c . -> . boolean?))
(current-proxy-servers
(case-> ((union false/c (listof (list/c string? string? number?))) . -> . void?)
(-> (union false/c (listof (list/c string? string? number?))))))))
(case-> ((or/c false/c (listof (list/c string? string? number?))) . -> . void?)
(-> (or/c false/c (listof (list/c string? string? number?))))))))

View File

@ -13,8 +13,8 @@
(define path-or-string? (lambda (x) (or (path? x) (string? x))))
(provide/contract
(get-info ((listof path-or-string?) . -> . (union info? boolean?)))
(get-info/full (path? . -> . (union info? boolean?)))
(get-info ((listof path-or-string?) . -> . (or/c info? boolean?)))
(get-info/full (path? . -> . (or/c info? boolean?)))
(find-relevant-directories (opt-> ((listof symbol?))
((lambda (x) (or (eq? x 'preferred)
(eq? x 'all-available))))

View File

@ -75,7 +75,7 @@
[slide/name/inset slide/title/inset-contract]
[slide/name/tall/inset slide/title/inset-contract]
[slide/name/center/inset slide/title/inset-contract]
[comment (() (listof (union string? pict?)) . ->* . any)])
[comment (() (listof (or/c string? pict?)) . ->* . any)])
(provide most-recent-slide retract-most-recent-slide re-slide start-at-recent-slide
scroll-transition pause-transition
make-outline

View File

@ -360,7 +360,7 @@
(unless (eq? new-frame drs-frame)
(error 'set-language-level! "didn't get drscheme frame back, got: ~s\n" new-frame))))))))
(provide/contract [check-language-level ((union string? regexp?) . -> . void?)])
(provide/contract [check-language-level ((or/c string? regexp?) . -> . void?)])
;; checks that the language in the drscheme window is set to the given one.
;; clears the definitions, clicks execute and checks the interactions window.
(define (check-language-level lang-spec)