Skip to content

Commit 8aecb34

Browse files
authored
Merge pull request #272 from mpwillson/master
Add example for *repl-prompt*
2 parents d37d0ce + 434f146 commit 8aecb34

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/_42repl-prompt_42.janet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(var ncmd 0)
2+
3+
(defn my-prompt
4+
`Takes a single argument p, the parser, and returns a prompt string.`
5+
[p]
6+
(++ ncmd)
7+
(string/format "[%d]> " ncmd))
8+
9+
(setdyn :repl-prompt my-prompt)

0 commit comments

Comments
 (0)