From 286d1d8e97e0a218d5b434f7c4babede7e602db4 Mon Sep 17 00:00:00 2001 From: Magnar Sveen Date: Tue, 2 Oct 2012 18:20:35 +0200 Subject: [PATCH] Show quotes around strings in examples. --- README.md | 4 ++-- examples-to-docs.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3651055..88b4947 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,8 @@ exposed as `acc`. ```cl (!reduce '+ '(1 2)) ;; => 3 -(!reduce (lambda (memo item) (format %s-%s memo item)) '(1 2 3)) ;; => 1-2-3 -(!!reduce (format %s-%s acc it) '(1 2 3)) ;; => 1-2-3 +(!reduce (lambda (memo item) (format "%s-%s" memo item)) '(1 2 3)) ;; => "1-2-3" +(!!reduce (format "%s-%s" acc it) '(1 2 3)) ;; => "1-2-3" ``` ### !filter `(fn list)` diff --git a/examples-to-docs.el b/examples-to-docs.el index 12a9c25..72fc55a 100644 --- a/examples-to-docs.el +++ b/examples-to-docs.el @@ -5,7 +5,7 @@ (defun example-to-string (example) (let ((actual (car example)) (expected (cadr (cdr example)))) - (format "%s ;; => %s" actual expected))) + (replace-regexp-in-string "\\\\\\?" "?" (format "%S ;; => %S" actual expected)))) (defun examples-to-strings (examples) (let (result)