Skip to content

Commit c50a2ca

Browse files
committed
Add example for *repl-prompt*
1 parent d37d0ce commit c50a2ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/*repl-prompt*.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)