Closed Gavin-Holt closed 1 year ago
Hi
After reading on Rosetta Code :
((.) ">") => "" join :prompt
But this does not change when I move directories :(
I am betting there is a way to delay execution by passing a function?
Kind Regards Gavin Holt
Nearly there!
I believe this would work for you:
("[$1]> " (.) => %) :prompt
Basically yes, in this case we are using the interpolation symbol (%) to execute a quotation containing the current directory symbol (.).
Also, if you put the above line in your .minrc file in your home directory (see docs) it will reset the default prompt every time you start min 😊
Hi,
Sorry I must be doing something wrong as I am getting a fatal error:
C:\Windows>ver
Microsoft Windows [Version 10.0.19042.1826]
C:\Windows>min.exe
min shell v0.37.0
[C:/Windows]
$ ("[$1]> " (.) => % ) :prompt
parser.nim(136) raiseInvalid
Error: unhandled exception: Quotation is not a quoted symbol [MinInvalidError:ObjectType]
I have trialled using this code separately in the REPL, in my prelude file (-p switch) and in C:\Users\gavin.holt\.minrc with no luck.
Kind Regards Gavin
Oops! You are right... wrong sigil, the prompt symbol must be set to a quotation so it's necessary to use the lambda sigil (^
) instead of define (:
)... try this:
("[$1]> " (.) => % ) ^prompt
Hi
Perfect, many thanks.
Kind Regards Gavin Holt
Hi
I am keen to play with min, but I am failing at my first hurdle.
This will be my second programming language after Lua - I'm not an IT professional.
As a long time DOS user, I find the shell prompt unappealing. The documentation says it is
unsealed
and can be changed, but can't seem to find the right code.My current prompt (it's the newline I really don't like):
My desired prompt (similar to DOS):
If I execute,
prompt
then it returns a string:I tried to reset the prompt by placing a
quotation
on the stack (from reference-lang):I guess this is not the right way to change the prompt.
Any help gratefully received.
Kind Regards Gavin Holt