.. but now stuck on how to convert the "1001" string into a (1 0 0 1) integer list. Any help appreciated --- thanks!
an iterative solution:
(loop for digit across (write-to-string 9 :base 2) collect
(if (char= digit #\1) 1 0))
or a more functional solution:
(map 'list
#'(lambda (x) (if (char= x #\1) 1 0))
(write-to-string 9 :base 2))
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 70 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 37:48:47 |
| Calls: | 948 |
| Calls today: | 2 |
| Files: | 1,325 |
| Messages: | 280,560 |