diff --git a/examples/_42repl-prompt_42.janet b/examples/_42repl-prompt_42.janet new file mode 100644 index 0000000..a5c1a20 --- /dev/null +++ b/examples/_42repl-prompt_42.janet @@ -0,0 +1,9 @@ +(var ncmd 0) + +(defn my-prompt + `Takes a single argument p, the parser, and returns a prompt string.` + [p] + (++ ncmd) + (string/format "[%d]> " ncmd)) + +(setdyn :repl-prompt my-prompt)