Page 1 of 1

Colored output in REPL mode and (help) function

Posted: Mon Mar 26, 2012 7:37 am
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)
...

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

Posted: Mon Mar 26, 2012 11:41 am
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

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

Posted: Fri Mar 30, 2012 9:21 am
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!