summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-12-12 22:29:12 -0500
committerDavid Thompson <dthompson2@worcester.edu>2013-12-12 22:29:12 -0500
commit627f3ef4da15ac23f9959e72ed5cfb1855650b05 (patch)
treec73bfcf6c605a7d06902d5c54d657bdbb7e27db2 /2d
parentdf45474ac007467d5f837dfc6444e460b5b4d765 (diff)
Make init a non-keyword argument in make-signal procedure.
* 2d/signals.scm (make-signal): Change parameter list. * 2d/mouse.scm (mouse-position): Remove #:init keyword. * 2d/time.scm (time-interval, time-delay): Remove #:init keyword. * 2d/window.scm (window-size): Remove #:init keyword.
Diffstat (limited to '2d')
-rw-r--r--2d/mouse.scm2
-rw-r--r--2d/signals.scm9
-rw-r--r--2d/time.scm4
-rw-r--r--2d/window.scm2
4 files changed, 8 insertions, 9 deletions
diff --git a/2d/mouse.scm b/2d/mouse.scm
index 1c118b2..bd11678 100644
--- a/2d/mouse.scm
+++ b/2d/mouse.scm
@@ -33,7 +33,7 @@
(define mouse-last-down (make-signal))
(define mouse-last-up (make-signal))
-(define mouse-position (make-signal #:init (vector2 0 0)))
+(define mouse-position (make-signal (vector2 0 0)))
(define (mouse-down? button)
"Create a signal for the state of BUTTON. Value is #t when mouse
diff --git a/2d/signals.scm b/2d/signals.scm
index 85cc5af..cd5cba0 100644
--- a/2d/signals.scm
+++ b/2d/signals.scm
@@ -79,10 +79,9 @@
"Keep all values."
#t)
-(define* (make-signal #:optional #:key
+(define* (make-signal #:optional init #:key
(transformer identity-transform)
(filter keep-all)
- (init #f)
(connectors '()))
"Create a new signal with initial value INIT that uses the given
TRANSFORMER procedure to process incoming values from another
@@ -200,7 +199,7 @@ list."
"Create a new signal that accumulates the current and previous
values of SIGNAL using PROC."
(make-signal
- #:init init
+ init
#:transformer (lambda (value prev from)
(proc value prev))
#:connectors (list signal)))
@@ -264,7 +263,7 @@ of SIGNALS."
PREDICATE is true. INIT specifies the value that is set if PREDICATE
is never true."
(make-signal
- #:init init
+ init
#:filter (lambda (value prev from)
(signal-ref predicate))
#:transformer (lambda (value prev from)
@@ -276,7 +275,7 @@ is never true."
PREDICATE is true. INIT specifies the value that is set if PREDICATE
is never true."
(make-signal
- #:init init
+ init
#:filter (lambda (value prev from)
(not (signal-ref predicate)))
#:transformer (lambda (value prev from)
diff --git a/2d/time.scm b/2d/time.scm
index cacfae4..6a6607e 100644
--- a/2d/time.scm
+++ b/2d/time.scm
@@ -31,7 +31,7 @@
(define (time-interval ticks signal)
"Create a new signal that emits the value of SIGNAL every TICKS
agenda updates."
- (let ((ticker (make-signal #:init (signal-ref signal))))
+ (let ((ticker (make-signal (signal-ref signal))))
(agenda-schedule-interval
(lambda ()
(signal-set! ticker (signal-ref signal))) ticks)
@@ -43,7 +43,7 @@ agenda updates."
(define (time-delay ticks signal)
(make-signal
- #:init (signal-ref signal)
+ (signal-ref signal)
#:filter (lambda (value old from)
(wait ticks)
#t)
diff --git a/2d/window.scm b/2d/window.scm
index 159a9a2..f520c7a 100644
--- a/2d/window.scm
+++ b/2d/window.scm
@@ -53,7 +53,7 @@
(fullscreen? #f))
(%make-window title resolution fullscreen?))
-(define window-size (make-signal #:init (vector2 0 0)))
+(define window-size (make-signal (vector2 0 0)))
(register-event-handler
'video-resize