简体   繁体   中英

How could I found the function definition in REPL?

After experiencing several times, finally, I got a function works. After a few tests, I believe I could put this function to the source code file. But now the function definition is a long way burred in the REPL. I tryed

(source my-function)

Unfortunately, it doesn't work. It only work on the functions in the lib.

So I have to scroll back, and search (within Cider-nrepl,Emacs).

Is there a better way?

Assuming you're function definition starts with defn , within Cider/Emacs, you can type (defn at the REPL and hit Mp (Meta-p or Esc-p). This will find any previous input to the REPL that started with (defn . Hitting Mp multiple times will allow you to go backwards through history, ie it will find all input starting with (defn .

This of course works also for all other input to the REPL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM