tidying
parent
50bd8e6301
commit
18081e6d6e
@ -1,24 +0,0 @@
|
||||
#lang racket/base
|
||||
(require (for-syntax racket/base) br/define)
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define-macro (define-case-macro ID PRED)
|
||||
#'(define-syntax (ID stx)
|
||||
(syntax-case stx ()
|
||||
[(_ test-val
|
||||
[(match-vals) . result] (... ...)
|
||||
[else . else-result])
|
||||
#'(cond
|
||||
[(PRED test-val '(match-vals)) . result] (... ...)
|
||||
[else . else-result])]
|
||||
[(_ test-val
|
||||
match-clause (... ...))
|
||||
#'(ID test-val
|
||||
match-clause (... ...)
|
||||
[else (error 'ID "no match")])])))
|
||||
|
||||
;; like case but strictly uses `eq?` comparison (as opposed to `equal?`)
|
||||
(define-case-macro caseq memq)
|
||||
|
||||
;; `eqv?` is OK for chars (same as `char=?`)
|
||||
(define-case-macro casev memv)
|
@ -1,11 +0,0 @@
|
||||
#lang racket/base
|
||||
(require racket/class
|
||||
racket/draw)
|
||||
|
||||
(provide (all-defined-out))
|
||||
(define (make-drracket-button . args)
|
||||
(define label (or (findf string? args) "untitled"))
|
||||
(define bitmap (or (findf (λ(arg) (is-a? arg bitmap%)) args) (make-object bitmap% 16 16)))
|
||||
(define callback (or (findf procedure? args) (λ(drr-frame) (void))))
|
||||
(define number (or (findf (λ(arg) (or (real? arg) (equal? #f arg))) args) #f))
|
||||
(list label bitmap callback number))
|
@ -1,19 +1,19 @@
|
||||
#lang racket
|
||||
(require racket/class)
|
||||
(provide (all-defined-out))
|
||||
|
||||
(require racket/class)
|
||||
(define (indenter t pos)
|
||||
(with-handlers ([exn:fail? (λ(exn) #f)]) ; this function won't work until gui-lib 1.26
|
||||
(with-handlers ([exn:fail? (λ (exn) #f)]) ; this function won't work until gui-lib 1.26
|
||||
(send t compute-racket-amount-to-indent pos (λ(x)
|
||||
(case x
|
||||
[("with-pattern" "with-shared-id") 'lambda]
|
||||
[("define-macro") 'define]
|
||||
[("with-pattern"
|
||||
"with-shared-id") 'lambda]
|
||||
[("define-macro"
|
||||
"define-macro-cases"
|
||||
"define-cases") 'define]
|
||||
[else #f])))))
|
||||
|
||||
(define (br-get-info key default default-filter)
|
||||
(case key
|
||||
#;[(color-lexer)
|
||||
(dynamic-require 'syntax-color/default-lexer 'default-lexer)]
|
||||
[(drracket:indentation) indenter]
|
||||
[else
|
||||
(default-filter key default)]))
|
||||
[else (default-filter key default)]))
|
Loading…
Reference in New Issue