ke=? changed to key=?

svn: r11200
This commit is contained in:
Matthias Felleisen 2008-08-12 12:56:30 +00:00
parent d8e9624382
commit b96fd759f3
5 changed files with 369 additions and 349 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
;; The first three lines of this file were inserted by DrScheme. They record metadata ;; 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. ;; 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"))))) #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)) (define plain (empty-scene 100 100))

View File

@ -23,11 +23,11 @@
(check-expect (key-event? 0) false) (check-expect (key-event? 0) false)
(check-expect (key-event? #\a) true) (check-expect (key-event? #\a) true)
(check-expect (ke=? 'a 'b) false) (check-expect (key=? 'a 'b) false)
(check-expect (ke=? 'a #\a) false) (check-expect (key=? 'a #\a) false)
(check-expect (ke=? 'left 'left) true) (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 ;; run world run

View File

@ -27,7 +27,7 @@ make-matrix ;; Nat Nat [Listof X] -> [Matrix X]
;; NOTE: make-matrix would consume an optional number of entries, ;; NOTE: make-matrix would consume an optional number of entries,
;; if it were like make-vector ;; 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 ;; create a matrix from a function
matrix-ref ;; [Matrix X] Nat Nat -> X matrix-ref ;; [Matrix X] Nat Nat -> X

View File

@ -12,6 +12,7 @@
(set! current-world new-world) (set! current-world new-world)
(when (C current-world) (render (F current-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? ;; 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 ;; Mon Jun 16 15:38:14 EDT 2008: removed end-of-time and provided stop-when
;; also allow repeated setting of callbacks now ;; also allow repeated setting of callbacks now
@ -130,7 +131,7 @@ Matthew
(provide (provide
key-event? ;; Any -> Boolean key-event? ;; Any -> Boolean
ke=? ;; KeyEvent KeyEvent -> Boolean key=? ;; KeyEvent KeyEvent -> Boolean
) )
(provide-higher-order-primitive (provide-higher-order-primitive
@ -297,9 +298,9 @@ Matthew
(define (key-event? k) (define (key-event? k)
(or (char? k) (symbol? k))) (or (char? k) (symbol? k)))
(define (ke=? k m) (define (key=? k m)
(check-arg 'ke=? (key-event? k) 'KeyEvent "first" k) (check-arg 'key=? (key-event? k) 'KeyEvent "first" k)
(check-arg 'ke=? (key-event? m) 'KeyEvent "first" m) (check-arg 'key=? (key-event? m) 'KeyEvent "first" m)
(eqv? k m)) (eqv? k m))
(define (on-key-event f) (define (on-key-event f)