Commit 67c99a79 authored by Juergen Nickelsen's avatar Juergen Nickelsen

more useful Bdoc

parent b5ea6916
......@@ -188,7 +188,18 @@ sub Berror {
sub Bdoc {
my ($arglist) = @_;
my ($funob) = checkargs($arglist, 'e');
return function_documentation(evalfun($funob));
my $func = evalfun($funob);
my $doc = function_documentation($func);
my $name = symbol_name(function_name($func));
my $type = function_type($func);
my $special = specialp($func);
my $desc = ($type eq 'expr' ? '' : 'builtin ')
. ($special ? 'special form' : 'function');
my $args = princs(function_args($func));
my $result = "$desc $name";
$result .= " " . $args if $args;
$result .= "\n" . $doc if $doc;
return $result;
}
sub Bprinc {
......
......@@ -22,7 +22,7 @@ BEGIN {
specialp caar cadr cdar cddr caaar caadr cadar caddr cdaar
cdadr cddar cdddr function_type function_code symbol_value
set function_name is_nil all_symbols remprop
function_documentation is_t cons_count
function_documentation is_t cons_count function_args
);
}
......@@ -120,6 +120,11 @@ sub function_code {
return $ob->{func};
}
sub function_args {
my ($ob) = @_;
return function_type($ob) eq 'expr' ? car($ob->{func}) : '';
}
sub set {
my ($sym, $value) = @_;
return $sym->{value} = $value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment