Add <readable-desc> and use it
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 2 Feb 2017 11:48:38 +0000 (05:48 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 2 Feb 2017 11:48:38 +0000 (05:48 -0600)
worlds/bricabrac.scm

index 036661c91120deab6795ce83dbaee03fe209f871..1035dd76173ff9187325478a6dba95538fa0643b 100644 (file)
       #:text (slot-ref actor 'read-text)))
 
 
       #:text (slot-ref actor 'read-text)))
 
 
+;; This one is just where reading is the same thing as looking
+;; at the description
+(define-class <readable-desc> (<gameobj>)
+  (commands
+   #:allocation #:each-subclass
+   #:init-thunk (build-commands
+                 ("read" ((direct-command cmd-look-at))))))
+
 ;; This one allows you to take from items that are proxied by it
 (define-actor <proxy-items> (<gameobj>)
   ((cmd-take-from take-from-proxy))
 ;; This one allows you to take from items that are proxied by it
 (define-actor <proxy-items> (<gameobj>)
   ((cmd-take-from take-from-proxy))
@@ -1435,98 +1443,92 @@ as well as an exit leading to the south."))
         ,@placard)
       #:goes-by '("list of exhibits" "exhibit list" "list" "exhibits")
       #:read-text placard))
         ,@placard)
       #:goes-by '("list of exhibits" "exhibit list" "list" "exhibits")
       #:read-text placard))
-   (let ((desc
-          '((p "It's a three-piece exhibit, with three little dioramas and some text "
-               "explaining what they represent.  They are:")
-            (ul (li (b "Late 2015/Early 2016 talk: ")
-                    "This one explains the run-up conversation from late 2015 "
-                    "and early 2016 about the need for an "
-                    "\"asynchronous event loop for Guile\".  The diorama "
-                    "is a model of the Veggie Galaxy restaurant where after "
-                    "the FSF 30th anniversary party; Mark Weaver, Christopher "
-                    "Allan Webber, David Thompson, and Andrew Engelbrecht chat "
-                    "about the need for Guile to have an answer to asynchronous "
-                    "programming.  A mailing list post " ; TODO: link it?
-                    "summarizing the discussion is released along with various "
-                    "conversations around what is needed, as well as further "
-                    "discussion at FOSDEM 2016.")
-                (li (b "Early implementations: ")
-                    "This one shows Chris Webber's 8sync and Chris Vine's "
-                    "guile-a-sync, both appearing in late 2015 and evolving "
-                    "into their basic designs in early 2016.  It's less a diorama "
-                    "than a printout of some mailing list posts.  Come on, the "
-                    "curators could have done better with this one.")
-                (li (b "Suspendable ports and Fibers: ")
-                    "The diorama shows Andy Wingo furiously hacking at his keyboard. "
-                    "The description talks about Wingo's mailing list thread "
-                    "about possibly breaking Guile compatibility for a \"ports refactor\". "
-                    "Wingo releases Fibers, another asynchronous library, making use of "
-                    "the new interface, and 8sync and guile-a-sync "
-                    "quickly move to support suspendable ports as well. "
-                    "The description also mentions that there is an exhibit entirely "
-                    "devoted to suspendable ports."))
-            (p "Attached at the bottom is a post it note mentioning "
-               "https integration landing in Guile 2.2."))))
-     (list
-      'async-museum:2016-progress-exhibit
-      <readable> 'async-museum
-      #:name "2016 Progress Exhibit"
-      #:goes-by '("2016 progress exhibit" "2016 progress" "2016 exhibit")
-      #:desc desc
-      #:read-text desc))
-   (let ((desc
-          '((p "This exhibit is a series of charts explaining the similarities "
-               "and differences between 8sync and Fibers, two asynchronous programming "
-               "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
-            (p (b "Similarities:")
-               (ul (li "Both use Guile's suspendable-ports facility")
-                   (li "Both use message passing")))
-            (p (b "Differences:")
-               (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
-                       "but 8sync actors only read from one \"inbox\" each.")
-                   (li "Different theoretical basis:"
-                       (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
-                               "a form of Process Calculi")
-                           (li "8sync: based on the Actor Model")
-                           (li "Luckily CSP and the Actor Model are \"dual\"!")))))
-            (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
-               "whereas 8sync is designed by Chris Webber, who built this crappy "
-               "hotel simulator."))))
-     (list
-      'async-museum:8sync-and-fibers-exhibit
-      <readable> 'async-museum
-      #:name "8sync and Fibers Exhibit"
-      #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
-      #:desc desc
-      #:read-text desc))
-   (let ((desc
-          '((p "This exhibit is a series of charts explaining the similarities "
-               "and differences between 8sync and Fibers, two asynchronous programming "
-               "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
-            (p (b "Similarities:")
-               (ul (li "Both use Guile's suspendable-ports facility")
-                   (li "Both use message passing")))
-            (p (b "Differences:")
-               (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
-                       "but 8sync actors only read from one \"inbox\" each.")
-                   (li "Different theoretical basis:"
-                       (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
-                               "a form of Process Calculi")
-                           (li "8sync: based on the Actor Model")
-                           (li "Luckily CSP and the Actor Model are \"dual\"!")))))
-            (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
-               "whereas 8sync is designed by Chris Webber, who built this crappy "
-               "hotel simulator."))))
-     (list
-      'async-museum:8sync-and-fibers-exhibit
-      <readable> 'async-museum
-      #:name "8sync and Fibers Exhibit"
-      #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
-      #:desc desc
-      #:read-text desc))
+   (list
+    'async-museum:2016-progress-exhibit
+    <readable-desc> 'async-museum
+    #:name "2016 Progress Exhibit"
+    #:goes-by '("2016 progress exhibit" "2016 progress" "2016 exhibit")
+    #:desc
+    '((p "It's a three-piece exhibit, with three little dioramas and some text "
+         "explaining what they represent.  They are:")
+      (ul (li (b "Late 2015/Early 2016 talk: ")
+              "This one explains the run-up conversation from late 2015 "
+              "and early 2016 about the need for an "
+              "\"asynchronous event loop for Guile\".  The diorama "
+              "is a model of the Veggie Galaxy restaurant where after "
+              "the FSF 30th anniversary party; Mark Weaver, Christopher "
+              "Allan Webber, David Thompson, and Andrew Engelbrecht chat "
+              "about the need for Guile to have an answer to asynchronous "
+              "programming.  A mailing list post " ; TODO: link it?
+              "summarizing the discussion is released along with various "
+              "conversations around what is needed, as well as further "
+              "discussion at FOSDEM 2016.")
+          (li (b "Early implementations: ")
+              "This one shows Chris Webber's 8sync and Chris Vine's "
+              "guile-a-sync, both appearing in late 2015 and evolving "
+              "into their basic designs in early 2016.  It's less a diorama "
+              "than a printout of some mailing list posts.  Come on, the "
+              "curators could have done better with this one.")
+          (li (b "Suspendable ports and Fibers: ")
+              "The diorama shows Andy Wingo furiously hacking at his keyboard. "
+              "The description talks about Wingo's mailing list thread "
+              "about possibly breaking Guile compatibility for a \"ports refactor\". "
+              "Wingo releases Fibers, another asynchronous library, making use of "
+              "the new interface, and 8sync and guile-a-sync "
+              "quickly move to support suspendable ports as well. "
+              "The description also mentions that there is an exhibit entirely "
+              "devoted to suspendable ports."))
+      (p "Attached at the bottom is a post it note mentioning "
+         "https integration landing in Guile 2.2.")))
+   (list
+    'async-museum:8sync-and-fibers-exhibit
+    <readable-desc> 'async-museum
+    #:name "8sync and Fibers Exhibit"
+    #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
+    #:desc
+    '((p "This exhibit is a series of charts explaining the similarities "
+         "and differences between 8sync and Fibers, two asynchronous programming "
+         "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
+      (p (b "Similarities:")
+         (ul (li "Both use Guile's suspendable-ports facility")
+             (li "Both use message passing")))
+      (p (b "Differences:")
+         (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
+                 "but 8sync actors only read from one \"inbox\" each.")
+             (li "Different theoretical basis:"
+                 (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
+                         "a form of Process Calculi")
+                     (li "8sync: based on the Actor Model")
+                     (li "Luckily CSP and the Actor Model are \"dual\"!")))))
+      (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
+         "whereas 8sync is designed by Chris Webber, who built this crappy "
+         "hotel simulator.")))
+   (list
+    'async-museum:8sync-and-fibers-exhibit
+    <readable-desc> 'async-museum
+    #:name "8sync and Fibers Exhibit"
+    #:goes-by '("8sync and fibers exhibit" "8sync exhibit" "fibers exhibit")
+    #:desc
+    '((p "This exhibit is a series of charts explaining the similarities "
+         "and differences between 8sync and Fibers, two asynchronous programming "
+         "libraries for GNU Guile.  It's way too wordy, but you get the general gist.")
+      (p (b "Similarities:")
+         (ul (li "Both use Guile's suspendable-ports facility")
+             (li "Both use message passing")))
+      (p (b "Differences:")
+         (ul (li "Fibers \"processes\" can read from multiple \"channels\", "
+                 "but 8sync actors only read from one \"inbox\" each.")
+             (li "Different theoretical basis:"
+                 (ul (li "Fibers: based on CSP (Communicating Sequential Processes), "
+                         "a form of Process Calculi")
+                     (li "8sync: based on the Actor Model")
+                     (li "Luckily CSP and the Actor Model are \"dual\"!")))))
+      (p "Fibers is also designed by Andy Wingo, an excellent compiler hacker, "
+         "whereas 8sync is designed by Chris Webber, who built this crappy "
+         "hotel simulator.")))
    (list
     'async-museum:suspendable-ports-exhibit
    (list
     'async-museum:suspendable-ports-exhibit
-    <gameobj> 'async-museum
+    <readable-desc> 'async-museum
     #:name "Suspendable Ports Exhibit"
     #:goes-by '("suspendable ports exhibit" "ports exhibit"
                 "suspendable exhibit" "suspendable ports" "ports")
     #:name "Suspendable Ports Exhibit"
     #:goes-by '("suspendable ports exhibit" "ports exhibit"
                 "suspendable exhibit" "suspendable ports" "ports")
@@ -1538,7 +1540,7 @@ as well as an exit leading to the south."))
       (p "Fibers, 8sync, and guile-a-sync now support suspendable ports.")))
    (list
     'async-museum:actor-model-exhibit
       (p "Fibers, 8sync, and guile-a-sync now support suspendable ports.")))
    (list
     'async-museum:actor-model-exhibit
-    <gameobj> 'async-museum
+    <readable-desc> 'async-museum
     #:name "Actor Model Exhibit"
     #:goes-by '("actor model exhibit" "actor exhibit"
                 "actor model")
     #:name "Actor Model Exhibit"
     #:goes-by '("actor model exhibit" "actor exhibit"
                 "actor model")
@@ -1769,7 +1771,7 @@ network.")
    ;; activitypub poster
    ;; conspiracy chart
    ('federation-station:conspiracy-chart
    ;; activitypub poster
    ;; conspiracy chart
    ('federation-station:conspiracy-chart
-    <gameobj> 'federation-station
+    <readable-desc> 'federation-station
     #:name "a conspiracy chart"
     #:goes-by '("conspiracy chart" "chart")
     #:desc
     #:name "a conspiracy chart"
     #:goes-by '("conspiracy chart" "chart")
     #:desc