Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed name of the effectful handlers to usee bang instead of star.

  • Loading branch information...
commit 1374bc2c7a9a9937df85b052b75bd41cb5d12365 1 parent cd4cc25
Danny Yoo authored
View
4 examples/bell-choir.ss
@@ -49,7 +49,7 @@
(define button-down
(js-button down '(("id" "button-down"))))
(define button-ring
- (js-button* shake ring '(("id" "button-ring"))))
+ (js-button! shake ring '(("id" "button-ring"))))
(define background-div
(js-div '(("id" "background-div"))))
@@ -101,5 +101,5 @@
(js-big-bang initial-world
(initial-effect (make-effect:set-sound-volume 90))
- (on-shake* shake ring)
+ (on-shake! shake ring)
(on-draw render render-css))
View
2  examples/homeward-bound.ss
@@ -463,7 +463,7 @@
(js-big-bang initial-world
(on-location-change move)
- (on-tick* TICK-DELAY
+ (on-tick! TICK-DELAY
record-reporting send-report)
(on-draw draw draw-css))
View
6 examples/lullaby.ss
@@ -110,7 +110,7 @@
;; Produces an HTML page for the user interface.
(define (draw a-world)
(list (js-div '(("id" "top")))
- (list (js-button*
+ (list (js-button!
identity
(lambda (w)
(make-effect:pick-playlist update-playlist)))
@@ -132,7 +132,7 @@
(js-big-bang initial-world
- (on-tick* 1 tick get-effects)
- (on-shake* shake get-effects)
+ (on-tick! 1 tick get-effects)
+ (on-shake! shake get-effects)
(on-draw draw draw-css))
View
8 manual.scrbl
@@ -246,7 +246,7 @@ Constructs a button. When the button is pressed, the world is updated through @
-@defproc[(js-button* (world-update-f (world -> world))
+@defproc[(js-button! (world-update-f (world -> world))
(effect-f (world -> effect))
(attribs (listof attrib) '()))
dom-element]{
@@ -294,8 +294,8 @@ to the button.
Stimulus handlers are provided as additional arguments to a js-big-bang.
-Each stimulus has an unstarred and a starred version; the starred
-version allows you to provide an effect-generating function. When
+Each stimulus has an effect-less and an effect-full version; the effect-full
+version allows you to provide an effect-generating function as well as a world-updater. When
the given stimulus emits, the old world is used to compute both
the new world and the optional effect. Afterwards, each effect in the
effect group is applied.
@@ -353,7 +353,7 @@ Calls the acceleration handlers when the device feels change in acceleration.
@subsection{Effects}
Effects allow world programs to apply side effects to the outside
-world. These are used in conjunction with the starred version of the
+world. These are used in conjunction with the effect (@scheme[!]) version of the
stimulus handlers described above.
View
18 src/compiler/modules.ss
@@ -85,18 +85,18 @@
(make-module-binding 'world-config
module-path
(list (bf 'on-tick module-path 2 false "plt.world.config.Kernel.onTick")
- (bf 'on-tick* module-path 3 false "plt.world.config.Kernel.onTick_star_")
+ (bf 'on-tick! module-path 3 false "plt.world.config.Kernel.onTick_star_")
(bf 'on-mouse module-path 1 false "plt.world.config.Kernel.onMouse")
- (bf 'on-mouse* module-path 2 false "plt.world.config.Kernel.onMouse_star_")
+ (bf 'on-mouse! module-path 2 false "plt.world.config.Kernel.onMouse_star_")
(bf 'initial-effect module-path 1 false "plt.world.config.Kernel.initialEffect")
(bf 'on-key module-path 1 false "plt.world.config.Kernel.onKey")
- (bf 'on-key* module-path 2 false "plt.world.config.Kernel.onKey_star_")
+ (bf 'on-key! module-path 2 false "plt.world.config.Kernel.onKey_star_")
(bf 'on-announce module-path 1 false "plt.world.config.Kernel.onAnnounce")
- (bf 'on-announce* module-path 2 false "plt.world.config.Kernel.onAnnounce_star_")
+ (bf 'on-announce! module-path 2 false "plt.world.config.Kernel.onAnnounce_star_")
(make-binding:function
'on-location-change module-path 1 false
@@ -104,7 +104,7 @@
(list PERMISSION:LOCATION)
false)
(make-binding:function
- 'on-location-change* module-path 2 false
+ 'on-location-change! module-path 2 false
"plt.world.config.Kernel.onLocationChange_star_"
(list PERMISSION:LOCATION)
false)
@@ -115,7 +115,7 @@
(list PERMISSION:TILT)
false)
(make-binding:function
- 'on-tilt* module-path 2 false
+ 'on-tilt! module-path 2 false
"plt.world.config.Kernel.onTilt_star_"
(list PERMISSION:TILT)
false)
@@ -127,7 +127,7 @@
false)
(make-binding:function
- 'on-acceleration* module-path 2 false
+ 'on-acceleration! module-path 2 false
"plt.world.config.Kernel.onAcceleration_star_"
(list PERMISSION:TILT)
false)
@@ -139,7 +139,7 @@
false)
(make-binding:function
- 'on-shake* module-path 2 false
+ 'on-shake! module-path 2 false
"plt.world.config.Kernel.onShake_star_"
(list PERMISSION:SHAKE)
false)
@@ -361,7 +361,7 @@
(bf 'js-div 0 "plt.world.MobyJsworld.div")
(bf 'js-p 0 "plt.world.MobyJsworld.p")
(bf 'js-button 1 "plt.world.MobyJsworld.button")
- (bf 'js-button* 2 "plt.world.MobyJsworld.buttonStar")
+ (bf 'js-button! 2 "plt.world.MobyJsworld.buttonStar")
(bf 'js-input 2 "plt.world.MobyJsworld.input")
(bf 'js-img 1
"plt.world.MobyJsworld.img")
View
14 src/moby-lang.ss
@@ -54,12 +54,12 @@
remove
;; Configuration handlers
- on-key on-key*
- on-tick on-tick*
- on-location-change on-location-change*
- on-tilt on-tilt*
- on-acceleration on-acceleration*
- on-shake on-shake*
+ on-key on-key!
+ on-tick on-tick!
+ on-location-change on-location-change!
+ on-tilt on-tilt!
+ on-acceleration on-acceleration!
+ on-shake on-shake!
on-redraw on-draw
stop-when
initial-effect
@@ -70,7 +70,7 @@
js-div
js-p
js-button
- js-button*
+ js-button!
js-input
#;js-bidirectional-input
js-img
View
4 src/stub/jsworld.ss
@@ -22,7 +22,7 @@
(define (js-button f (attrs '()))
(make-jsworld-widget:button attrs f (lambda (w) '())))
-(define (js-button* f ef (attrs '()))
+(define (js-button! f ef (attrs '()))
(make-jsworld-widget:button attrs f ef))
(define (js-input type update-f (attrs '()))
@@ -51,7 +51,7 @@
[js-button (((any/c . -> . any/c))
(attrs/c)
. ->* . jsworld-widget?)]
- [js-button* (((any/c . -> . any/c)
+ [js-button! (((any/c . -> . any/c)
(any/c . -> . any/c))
(attrs/c)
. ->* .
View
12 src/stub/world-config.ss
@@ -19,37 +19,37 @@
(define (on-key f)
(make-world-config:on-key f (lambda (w k) '())))
-(define (on-key* f ef)
+(define (on-key! f ef)
(make-world-config:on-key f ef))
(define (on-tick delay f)
(make-world-config:on-tick delay f (lambda (w) '())))
-(define (on-tick* delay f ef)
+(define (on-tick! delay f ef)
(make-world-config:on-tick delay f ef))
(define (on-location-change f)
(make-world-config:on-location-change f (lambda (w lat long) '())))
-(define (on-location-change* f ef)
+(define (on-location-change! f ef)
(make-world-config:on-location-change f ef))
(define (on-tilt f)
(make-world-config:on-tilt f (lambda (w azimuth pitch roll) '())))
-(define (on-tilt* f ef)
+(define (on-tilt! f ef)
(make-world-config:on-tilt f ef))
(define (on-acceleration f)
(make-world-config:on-acceleration f (lambda (w x y z) '())))
-(define (on-acceleration* f ef)
+(define (on-acceleration! f ef)
(make-world-config:on-acceleration f ef))
(define (on-shake f)
(make-world-config:on-shake f (lambda (w) '())))
-(define (on-shake* f ef)
+(define (on-shake! f ef)
(make-world-config:on-shake f ef))
(define (on-redraw f)
Please sign in to comment.
Something went wrong with that request. Please try again.