Fork me on GitHub
#cursive
<
2018-01-03
>
val_waeselynck07:01:58

@cfleming @jrheard FWIW copying the last REPL output would be enough for me

cfleming07:01:26

@val_waeselynck Yeah, we’ve discussed that here before, that’s probably a good 80% solution.

cfleming07:01:34

And useful for other things too.

nblumoe08:01:30

Hey, I am quite surprised that this is blocked by perceiving it as a combinatorial explosion. Cider has 10 eval commands, some also have a prefix version (http://cider.readthedocs.io/en/latest/interactive_programming/). So that would be max. 20, some are already present in Cursive, some are not needed. Having at least a subset of those commands would be really cool.

nblumoe08:01:26

I also like the “copy REPL output to clipboard” idea though! 👍

roman01la16:01:05

@cfleming Is it possible to add custom command in Cursive that receive, process in the REPL and return back data? For example something like eval and replace

cfleming21:01:12

@nblumoe Thanks for the doc link. It’s interesting the ones they’ve chosen to implement. They support three “sources” - form before point, top level form and surrounding sexp (which I don’t support but will do, people have asked for it). Cursive additionally supports sending the selection, but that’s overloaded - the other commands will send the selection if it exists rather than what they would normally use.

cfleming21:01:25

But the ops available for each source aren’t very consistent - you can debug a top-level form but not the form before point, and you can replace the form before point with the result but not the top-level form.

cfleming21:01:39

They have 4 ops - send to REPL and eval, send to REPL and replace, send to REPL and pprint result, debug in REPL. Cursive doesn’t need debug and it always pprints, so maybe it only needs two.

cfleming21:01:16

That’s then 6 commands, which seems pretty manageable.

cfleming21:01:39

And copying the last REPL output allows for some flexibility too.

cfleming21:01:00

@roman01la Can you give me an example of the sort of thing you’d like to do? Would replacing the original form work? Would being able to easily copy the last REPL result be sufficient?

snoe22:01:03

In vim I would wrap many MB edn files/logs in a pprint then send to repl and replace, as long as the clipboard can handle it, it would be fine

roman01la23:01:05

@cfleming I’d like to be able to create commands that run arbitrary code on a selection and print results into the REPL

cfleming23:01:22

@roman01la Oh, yes, that you can do. See https://cursive-ide.com/userguide/repl.html#repl-commands. One thing that is not documented there is that you can use ~selection in your commands.

cfleming23:01:45

Let me know if that doesn’t meet your needs.