ke=? changed to key=?
svn: r11200
This commit is contained in:
parent
d8e9624382
commit
b96fd759f3
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
;; The first three lines of this file were inserted by DrScheme. They record metadata
|
||||
;; about the language level of this file in a form that our tools can easily process.
|
||||
#reader(lib "htdp-beginner-reader.ss" "lang")((modname world-add-line) (read-case-sensitive #t) (teachpacks ((lib "world.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "world.ss" "teachpack" "htdp")))))
|
||||
(require htdp/world)
|
||||
;(require htdp/world)
|
||||
|
||||
(define plain (empty-scene 100 100))
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
(check-expect (key-event? 0) false)
|
||||
(check-expect (key-event? #\a) true)
|
||||
|
||||
(check-expect (ke=? 'a 'b) false)
|
||||
(check-expect (ke=? 'a #\a) false)
|
||||
(check-expect (ke=? 'left 'left) true)
|
||||
(check-expect (key=? 'a 'b) false)
|
||||
(check-expect (key=? 'a #\a) false)
|
||||
(check-expect (key=? 'left 'left) true)
|
||||
|
||||
(check-error (ke=? 'a 0) "ke=?: expected <KeyEvent> as first argument, given: 0")
|
||||
(check-error (key=? 'a 0) "key=?: expected <KeyEvent> as first argument, given: 0")
|
||||
|
||||
|
||||
;; run world run
|
||||
|
|
|
@ -27,7 +27,7 @@ make-matrix ;; Nat Nat [Listof X] -> [Matrix X]
|
|||
;; NOTE: make-matrix would consume an optional number of entries,
|
||||
;; if it were like make-vector
|
||||
|
||||
build-matrix ;; Nat Nat (Nat Nat -> Number) -> Matrix
|
||||
build-matrix ;; Nat Nat (Nat Nat -> X) -> [Matrix X]
|
||||
;; create a matrix from a function
|
||||
|
||||
matrix-ref ;; [Matrix X] Nat Nat -> X
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
(set! current-world new-world)
|
||||
(when (C current-world) (render (F current-world))))
|
||||
|#
|
||||
;; Tue Aug 12 08:54:45 EDT 2008: ke=? changed to key=?
|
||||
;; Fri Jul 4 10:25:47 EDT 2008: added ke=? and key-event?
|
||||
;; Mon Jun 16 15:38:14 EDT 2008: removed end-of-time and provided stop-when
|
||||
;; also allow repeated setting of callbacks now
|
||||
|
@ -130,7 +131,7 @@ Matthew
|
|||
|
||||
(provide
|
||||
key-event? ;; Any -> Boolean
|
||||
ke=? ;; KeyEvent KeyEvent -> Boolean
|
||||
key=? ;; KeyEvent KeyEvent -> Boolean
|
||||
)
|
||||
|
||||
(provide-higher-order-primitive
|
||||
|
@ -297,9 +298,9 @@ Matthew
|
|||
(define (key-event? k)
|
||||
(or (char? k) (symbol? k)))
|
||||
|
||||
(define (ke=? k m)
|
||||
(check-arg 'ke=? (key-event? k) 'KeyEvent "first" k)
|
||||
(check-arg 'ke=? (key-event? m) 'KeyEvent "first" m)
|
||||
(define (key=? k m)
|
||||
(check-arg 'key=? (key-event? k) 'KeyEvent "first" k)
|
||||
(check-arg 'key=? (key-event? m) 'KeyEvent "first" m)
|
||||
(eqv? k m))
|
||||
|
||||
(define (on-key-event f)
|
||||
|
|
Loading…
Reference in New Issue
Block a user