X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=doc%2F8sync.texi;fp=doc%2F8sync.texi;h=67eba86d284a1b1fdb855300ae826e4bf9c565d1;hp=1d9e4af0c5f457b3aea06db974b507dd2e932cd4;hb=8bdfa5c8f81d4e46d57c367da23cd8ea676ad717;hpb=c32aa0d308ce33667168dc2c2f41b30f423fe158 diff --git a/doc/8sync.texi b/doc/8sync.texi index 1d9e4af..67eba86 100644 --- a/doc/8sync.texi +++ b/doc/8sync.texi @@ -440,7 +440,7 @@ How about an actor that start sleeping, and keeps sleeping? (define-class () (actions #:allocation #:each-subclass - #:init-value (build-actions + #:init-thunk (build-actions (*init* sleeper-loop)))) (define (sleeper-loop actor message) @@ -457,9 +457,12 @@ How about an actor that start sleeping, and keeps sleeping? We see some particular things in this example. One thing is that our @verb{~~} actor has an actions slot. This is used to look up what the "action handler" for a message is. -We have to set the #:allocation to either @verb{~#:each-subclass~} or -@verb{~#:class~}.@footnote{#:class should be fine, except there is @uref{https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25211,a bug in Guile} which keeps -us from using it for now.} +We have to set the #:allocation to either @verb{~#:each-subclass~} +and use @verb{~#:init-thunk~}.@footnote{@verb{~build-subclass~} returns +a thunk to be called later so that each subclass may correctly build +its own instance. This is important because the structure returned +contains a cache, which may vary from subclass to subclass based on +its inheritance structure.} The only action handler we've added is for @verb{~*init*~}, which is called implicitly when the actor first starts up.