diff options
author | lujun9972 <lujun9972@gmail.com> | 2016-04-29 21:41:25 +0800 |
---|---|---|
committer | lujun9972 <lujun9972@gmail.com> | 2016-04-29 21:41:25 +0800 |
commit | 44cb8b7c89fa2bd77709717b95aee2e661d82aba (patch) | |
tree | ada4f1e3f1f500e02636b30ff55d053569cca9f7 /dev | |
parent | f5e0457e88ec87aee7989e99609ec960c435557d (diff) |
The key and value could be not string
Diffstat (limited to 'dev')
-rw-r--r-- | dev/examples.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/dev/examples.el b/dev/examples.el index 1ef3680..e21db3c 100644 --- a/dev/examples.el +++ b/dev/examples.el @@ -309,7 +309,7 @@ (s-presence "foo") => "foo") (defexamples s-format - ;; One with an alist works + ;; One with an alist works (s-format "help ${name}! I'm ${malady}" 'aget @@ -331,6 +331,13 @@ #s(hash-table test equal data ("name" "nic" "malady" "on fire"))) => "help nic! I'm on fire" + ;; Don't have to be string + (s-format "I'm ${name}, ${sex}, ${age} years old" + 'aget + '((name . "Nick") (sex . male) (age . 2))) + => "I'm Nick, male, 2 years old" + + ;; Replacing case has no effect on s-format (let ((case-replace t)) (s-format "help ${NAME}!" 'aget '(("NAME" . "Nick")))) |