-
Hi. I have read a few articles like this Clojure one but then I can't find many of the functions described for Clojure in the Janet REPL. I use it a bit to build data types and see if the brackets are right and I load a program and test functions individually. But this is a good example. Every time something is broken I have to edit it in the editor, save it and then close the REPL, open it again to load the latest version, define all relevant parameter and then test the function again. I have the strong feeling that I am doing it not right. I found (doc) useful and eventually found (quit) to close it, but overall it feels there is probably more. As there is no documentation for the Janet REPL that I have found so far, how do you use it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You're thinking of editor integrations for the REPL rather than the REPL itself. |
Beta Was this translation helpful? Give feedback.
-
I find it a bit ironic that the mentioned article recommends the approach it does as one of the Clojure maintainers has advocated an approach which seems to be quite against typing directly into a REPL [1]. I also don't tend to type expressions at the REPL when working on a particular project. My editor is set up in such a way that I can "send" expressions to the REPL from source code and report on evaluation results. This has at least two benefits:
As for testing, one thing I do is to put expressions (and expected values) in a source file and evalutate them via editor commands to observe results. I also invoke the tests using There are more than a few testing options for Janet -- see here for a slightly dated summary. If you haven't chosen a method yet and are not particularly attached to a specific option, I recommend starting by looking at spork's test and @ianthehenry's judge. I mention these two because:
I don't have anything against the other options (one of mine is included!), it's just that I think the aforementioned two are good starting points and it may be easier to get help with either of them. Regarding "help via the REPL", although I do use Also, I have found the approach of trying to "do everything via the REPL or an editor" to be unnecessarily restrictive. I also look at the website docs (the core API page is particularly useful) as well as janetdocs. I'm working on some tools [2] for getting help and practice with Janet too -- which I also use from a terminal from time to time (though some parts of their functionality can be accessed via an editor as well). [1] See this transcript if interested. [2] For example, jref for general Janet callables and pdoc for Janet PEG info. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the answers. This gives me a lot to do to work through the mentioned resources :-) |
Beta Was this translation helpful? Give feedback.
I find it a bit ironic that the mentioned article recommends the approach it does as one of the Clojure maintainers has advocated an approach which seems to be quite against typing directly into a REPL [1].
I also don't tend to type expressions at the REPL when working on a particular project. My editor is set up in such a way that I can "send" expressions to the REPL from source code and report on evaluation results. This has at least two benefits:
…