File: bottles

package info (click to toggle)
scheme9 2025.08.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,080 kB
  • sloc: lisp: 16,752; ansic: 11,869; sh: 806; makefile: 237; sed: 6
file content (15 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
S9 LIB  (bottles)            ==>  list
        (bottles tens ones)  ==>  list

Generate the lyrics of the "99 bottles of beer" song using only
DEFINE-SYNTAX/SYNTAX-RULES (and a little bit of arithmetics).

(bottles)  ==>  ((99 bottles of beer on the wall)
                 (99 bottles of beer)
                 (take one down and pass it around)
                 (98 bottles of beer on the wall)
                 ...
                 (0 bottles of beer on the wall)
                 (0 bottles of beer)
                 (go to the store buy some more)
                 (99 bottles of beer on the wall))