diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-10-04 10:48:16 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-10-04 10:48:16 -0700 |
commit | 376fbf858f363f6645b3963b24bd7d3cabada262 (patch) | |
tree | 25c266dd99a6cc02d250cf3013a4cf2377bd86d0 /share | |
parent | 804dd44d22c9dbc8b007b559ee1d31bb27451090 (diff) | |
download | txr-376fbf858f363f6645b3963b24bd7d3cabada262.tar.gz txr-376fbf858f363f6645b3963b24bd7d3cabada262.tar.bz2 txr-376fbf858f363f6645b3963b24bd7d3cabada262.zip |
New: quip function for random humor.
Add this to your .txr_profile startup file.
* lisplib.c (quips_instantiate, quips_set_entries): New static
functions.
(lisplib_init): Register autoloading of quip.
* share/txr/stdlib/quips.tl: New file.
* txr.1: Documented.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/quips.tl | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/share/txr/stdlib/quips.tl b/share/txr/stdlib/quips.tl new file mode 100644 index 00000000..7bca9bb8 --- /dev/null +++ b/share/txr/stdlib/quips.tl @@ -0,0 +1,73 @@ +;; Copyright 2020 +;; Kaz Kylheku <kaz@kylheku.com> +;; Vancouver, Canada +;; All rights reserved. +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions are met: +;; +;; 1. Redistributions of source code must retain the above copyright notice, this +;; list of conditions and the following disclaimer. +;; +;; 2. Redistributions in binary form must reproduce the above copyright notice, +;; this list of conditions and the following disclaimer in the documentation +;; and/or other materials provided with the distribution. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(defvarl sys:%quips% + #("TXR was taped live before a studio audience. The laughter is genuine." + "Exclusive of recycled stuffing, TXR contains new materials only." + "TXR is not a toy, but should be kept within easy reach of children." + "Do not remove this label until TXR is delivered to the consumer." + "Remove TXR any time for a complete refund of your disk space." + "Store TXR in a cool, dry storage device. Keep out of direct sunlight." + "Do not operate heavy equipment or motor vehicles while using TXR." + "Use full-strength TXR for tough tasks, or dilute with shell scripts." + "TXR causes vomiting if accidentally ingested; no need to induce such." + "If unwanted side effects persist, discontinue use of TXR." + "TXR works even if the application surface is not free of dirt and grease." + "TXR may be used in areas that are not necessarily well ventilated." + "TXR's button pops up when original seal is broken." + "TXR is tested on nothing but animals (so to speak)." + "Disclaimer: TXR has been found to cure cancer in lab mice only." + "Garbage collection is on Tuesdays: bring unwanted pointers to curb by 7:30." + "Warning: may explode if heated, cooled or maintained at room temperature." + "TXR is made with 75% post-consumer recycled cons cells." + "Poke a few holes in TXR with a fork before heating in the microwave." + "Caution: objects in heap are farther from reality than they appear." + "TXR doesn't really whip the llama's ass so much as the lambda's." + "TXR is recommended for either internal or external use. Whatever, y'know?" + "TXR is enteric coated to release over 24 hours of lasting relief." + "TXR contains many small parts, unsuitable for children under 12 months." + "TXR is packaged by the byte; contents may compress during shipping." + "Discontinue coding TXR if experiencing dizziness or shortness of breath." + "Self-assembly keeps TXR costs low; but ask about our installation service!" + "Some mild discoloration of syntax highlighting may occur with age." + "TXR is made with equipment not contaminated by peanuts ... r-r-right?" + "TXR is believed by fools to be free of defects in workmanship and materials." + "Adults using TXR should be closely supervised by children." + "TXR may be worn in seven different ways, in any weather." + "TXR is light and portable; take it camping, or to the Bahamas." + "Psst! The complimentary Allen key that comes with TXR is inpired by IKEA." + "Ethically produced using volunteer geek labor in a first world country." + "Program contains violence and coarse language, demanding user indiscretion." + "TXR is written, directed and produced by, not to mention starring, Kaz." + "Emergency exits are located in the standard library." + "Your history may used for automatic recommendations, like 'stick to Python'." + "Without the generosity of users like you, this program would exist just fine." + )) + +(defparml sys:%quip-rand-state% (make-random-state)) + +(defun quip () + [sys:%quips% (rand (len sys:%quips%) sys:%quip-rand-state%)]) |