
Is anyone using rash as their main shell (https://rash-lang.org/)? I’ve been playing around with it the last days to do standard shell stuff, json stuff and simple computations interactively and I really like it, e.g. mapping functions onto piped lists read from a json file. E.g.: jq .data.some_list some.json \|> port->string \|> string->jsexpr \|> (map some_function_defined_in_the_session)

@samth I opened an issue with some initial data and thoughts. https://github.com/greghendershott/racket-mode/issues/522

I’m still at the stage where I can make progress doing more experiments, doing more thinking, and doing more deliberate not-thinking (i.e. letting this bounce around in my subconscious for some number of days, waiting for ideas to bubble up).
So I’m not necessarily looking for feedback or ideas; but also welcome any that anyone might have.

I commented on the issue

@katar38 has joined the channel

Why does read-line
always return ""
in the REPL and how can I use it (or something similar) to temporarily hijack stdin for a custom repl? I wrote something like (define (repl)
(let ([input (read-line)])
(unless (eof-object? input)
(print (eval-top input))
(repl))))
where eval-top
is a custom function

Have you looked at read-eval-print-loop
and friends?


Hm, thanks, I’ll give that whirl

A “real” terminal inside DrRacket would be great though. Didn’t someone work on a terminal?

I wasn’t able to get too far here; I couldn’t change the prompt even with (parameterize ([current-prompt-read (λ ()
(print "524-lang> ")
(let ([in ((current-get-interaction-input-port))])
((current-read-interaction) (object-name in) in)))])
(read-eval-print-loop))
and my eval-top
’s interface is to take a string, which it parses itself. I couldn’t figure out how to get the reader to fit that.

I think, you need to change current-read-interaction too.

Pretty hacky, but it works for me :slightly_smiling_face: (define (repl)
(parameterize ([current-read-interaction (λ (_ in)
(read-line in))]
[current-eval (λ (e)
(when (non-empty-string? (cdr e))
(eval-top (cdr e))))])
(read-eval-print-loop)))
cdr
because everything is (#%top-interaction . value)

I did try to install it on Windows, but did not make it. I don’t have libedit.dll, so I tried to install libreadline–5.dll, but the copy I found for Windows was considered an invalid Win32 application, so it did not run. I’m willing to try again, but I need to get some tasks done first. I suppose this weekend might be the best time I’ll have. We’ll see.

@frederic.espiau has joined the channel

@greg is there a way to hide “tail” tooltips in Racket Mode?

Not yet. There’s a pair of faces for them you can customize, but, that doesn’t affect showing the tooltip. Too noisy for you? I’ve been on the fence about that myself.

Yeah, it’s kinda too noisy for me.

I don’t mean to say it should be taken out. Perhaps it’s useful for some people. But having a configuration to disable just the “tail” tooltip would be nice

what does this tooltip mean? I find it noisy too plus I don’t understand it :laughing:

Say, you have
(if #t 1 2)
then 1
is in the tail position w.r.t. (if #t 1 2)
.
In DrRacket, there will be an arrow from 1
to (if #t 1 2)
. Racket Mode tries to simulate the arrow by using face + tooltip.

I see, thanks! then I confused it with another tooltip, this one:

I see it at the start of every define

That one is essentially the other end of the arrow.

I see, thank you