Added (procedure?)

This commit is contained in:
Justin Ethier 2015-02-23 13:10:58 -05:00
parent c2aecae29b
commit e056b72f6f
3 changed files with 19 additions and 0 deletions

View file

@ -494,6 +494,7 @@
((eq? p 'null?) "Cyc_is_null") ((eq? p 'null?) "Cyc_is_null")
((eq? p 'number?) "Cyc_is_number") ((eq? p 'number?) "Cyc_is_number")
((eq? p 'pair?) "Cyc_is_cons") ((eq? p 'pair?) "Cyc_is_cons")
((eq? p 'procedure?) "Cyc_is_procedure")
((eq? p 'string?) "Cyc_is_string") ((eq? p 'string?) "Cyc_is_string")
((eq? p 'eof-object?) "Cyc_is_eof_object") ((eq? p 'eof-object?) "Cyc_is_eof_object")
((eq? p 'symbol?) "Cyc_is_symbol") ((eq? p 'symbol?) "Cyc_is_symbol")

View file

@ -682,6 +682,23 @@ static object Cyc_is_char(object o){
return boolean_t; return boolean_t;
return boolean_f;} return boolean_f;}
static object Cyc_is_procedure(object o) {
int tag;
if (!nullp(o) && !is_value_type(o)) {
tag = type_of(o);
if (tag == closure0_tag ||
tag == closure1_tag ||
tag == closure2_tag ||
tag == closure3_tag ||
tag == closure4_tag ||
tag == closureN_tag ||
tag == primitive_tag) {
return boolean_t;
}
}
return boolean_f;
}
static object Cyc_is_eof_object(object o) { static object Cyc_is_eof_object(object o) {
if (!nullp(o) && !is_value_type(o) && type_of(o) == eof_tag) if (!nullp(o) && !is_value_type(o) && type_of(o) == eof_tag)
return boolean_t; return boolean_t;

View file

@ -550,6 +550,7 @@
null? null?
number? number?
pair? pair?
procedure?
string? string?
symbol? symbol?
current-input-port current-input-port