Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; eio.el --- Support for creating Elisp exercises
- ;; Author: Jason Lewis
- ;; Created: 5 June 2015
- ;; This file is not part of GNU Emacs.
- ;;; Commentary:
- ;;
- ;; Provides utility functions for stubbing elisp exercises
- ;;; Code:
- (defun stub-exercise (exercise)
- "Create the stub for EXERCISE."
- (let ((human-name (lisp-to-human exercise)))
- (concat ";;; " exercise ".el --- " human-name "Exercise (exercism)\n"
- "\n"
- ";;; Commentary:\n"
- "\n"
- ";;; Code:\n"
- "\n"
- "\n"
- "(provide '" exercise ")\n"
- ";;; " exercise ".el ends here")))
- (defun stub-test (exercise)
- "Stubs the test for EXERCISE."
- (let ((human-name (lisp-to-human exercise)))
- (concat ";;; " exercise "-test.el --- " human-name "Test (exercism)\n"
- "\n"
- ";;; Commentary:\n"
- "\n"
- ";;; Code:\n"
- "(load-file \"" exercise ".el\")\n"
- "\n"
- "\n"
- "\n"
- "(provide '" exercise "-test)\n"
- ";;; " exercise ".el ends here")))
- (defun lisp-to-human (title)
- "Takes a kebab-case TITLE and humanizes it. E.g., hello-world -> Hello World."
- (mapconcat 'identity
- (mapcar #'capitalize
- (split-string title "-")) " "))
- (provide 'eio)
- ;;; eio.el ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement