Colored output in REPL mode and (help) function

Q&A's, tips, howto's
Locked
denis
Posts: 20
Joined: Wed Apr 27, 2011 12:19 pm
Location: Petsamo, Murmansk, RU

Colored output in REPL mode and (help) function

Post by denis »

Good european morning, folks!

Could anyone advice me how to make colored output in REPL (in Linux)?

Also I thought it would be good to have something like:

Code: Select all

> (help curry)
Syntax: (curry func exp)

Transforms func from a function f(x, y) that takes two arguments into a function fx(y) that takes a single argument.  curry can be used on all functions taking two arguments.

Examples:
(set 'f (curry + 10))  → (lambda () (+ 10 (args 0)))
(map (curry list 'x) (sequence 1 5)) →  ((x 1) (x 2) (x 3) (x 4) (x 5))
for more comfortable learning of the language in the interactive mode. Plus it could be not only built-in functions, but also user-defined functions with help information somewhere around:

(define (my-func)
"...help information..."
....

or
# formatted help information
(define (my-func)
...

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Colored output in REPL mode and (help) function

Post by cormullion »

For coloured text, you can try ANSI codes:

Code: Select all

(print "\n\027[0;33m")
These can work. They're all listed somewhere...

For the help suggestion, there have been many solutions posted on this forum (which doesn't mean that they're easy to find... :): here, here, here,, here

denis
Posts: 20
Joined: Wed Apr 27, 2011 12:19 pm
Location: Petsamo, Murmansk, RU

Re: Colored output in REPL mode and (help) function

Post by denis »

Ahha, thanks! I see there are a lot of threads related to my question.
Also notion of .init.lsp was new for me, great!

Locked