Defines a lisp reader to read is CSV:
which is used to read in CSV files with
and the result is a list:
CL-USER> (csv:slurp #p"example.csv") ("example" "csv" "list" "result" "like" " this")
This program invokes the lisp reader, making it:
1) Potentially risky to use if the input it not trusted.
2) Resource intensive for medium to large files (>5MB).
Use with care.
Supports escaping quotes the CSV way, with quad quotes:
csv -> lisp
"""" -> "\""
Clone from github into asdf load directory and use ASDF to install:
$ git clone https://github.com/equwal/CSV $ sbcl CL-USER> (asdf:load-system :csv) T
By default backslashes are not escaped. CSV is expected to be a list of quoted items, like this:
In the emacs text editor there are some goofy commands that play games. M-x
(which means Alt+x) is the way to execute a command in the editor, so M-x dunnet
starts the game called "dunnet" which is a text adventure. I cheated and won.
Defining just one function and setting one variable is sufficient to win.
Here is a text map of the easy path.
The command prompt is a
- Directions Are: n,s,e,w,ne,se,nw,sw,u,d,in,out (so you might
First, save the game so you can restart easily later:
How you need to move around the world a bit. Dunnet will greet you:
You are at a dead end of a dirt road. The road goes to the east. In the distance you can see that it will eventually fork off. The trees here are very tall royal palms, and they are spaced equidistant from each other. There is a shovel here.
>feed bear food
>put cpu in computer
Now in M-: you must login to the VAX console
Eval: (setq dun-logged-in t)
back to the dungeon:
greeted by a $ prompt:
To get to endgame in the VAX console, define this with M-:
(defun dun-score (garb) 90)
Now back to the dungeon:
$ rlogin endgame
Congrats, now you get questions, here they all are with answers:
- What is your password on the machine called 'pokey'? robert
- What password did you use during anonymous ftp to gamma? foo
- Excluding the endgame, how many places are there where you can put treasures for points? 4 or four
- What is your login name on the 'endgame' machine? toukmond
- What is the nearest whole dollar to the price of the shovel? 20 or twenty
- What is the name of the bus company serving the town? mobytours
- Give either of the two last names in the mailroom, other than your own. collier
- What cartoon character is on the towel? snoopy
- What is the last name of the author of EMACS? stallman
- How many megabytes of memory is on the CPU board for the Vax? 2
- Which street in town is named after a U.S. state? vermont
- How many pounds did the weight weigh? ten
- Name the STREET which runs right over the subway stop. 4th
- How many corners are there in town (excluding the one with the Post Office)? 24
- What type of bear was hiding your key? grizzly
- Name either of the two objects you found by digging. cpu
- What network protocol is used between pokey and gamma? ip
So you might do:
there are three quesions in total:
(naturally, you deserve it you cheater)!
(you dirty cheater)
Congrats you are in the winner's room.
Now you can actually play it if you want.
Coleslaw is a static content generator, similar to Jekyll or Wordpress, written in Common Lisp. It supports Markdown, cl-who, and some other formats. I have written a very hacky org-mode format implementation that uses undocumented internals. Unfortunantly the only alternative is to require that everything is done from within Emacs by a user, instead of being able submit from the Common Lisp REPL. Hopefully I can petition to get the one function made external and supported, but otherwise you can expect this code to maybe randomly break in the future.
How it works
Just write a regular org-mode file, without any coleslaw headers. Everything is
done via org, so use org headers like
#+TITLE for metadata.
- Tagging integration with coleslaw (so RSS feeds work, for example).
This blog covers article