mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-03 19:26:34 +02:00
Added (procedure?)
This commit is contained in:
parent
c2aecae29b
commit
e056b72f6f
3 changed files with 19 additions and 0 deletions
1
cgen.scm
1
cgen.scm
|
@ -494,6 +494,7 @@
|
|||
((eq? p 'null?) "Cyc_is_null")
|
||||
((eq? p 'number?) "Cyc_is_number")
|
||||
((eq? p 'pair?) "Cyc_is_cons")
|
||||
((eq? p 'procedure?) "Cyc_is_procedure")
|
||||
((eq? p 'string?) "Cyc_is_string")
|
||||
((eq? p 'eof-object?) "Cyc_is_eof_object")
|
||||
((eq? p 'symbol?) "Cyc_is_symbol")
|
||||
|
|
17
runtime.h
17
runtime.h
|
@ -682,6 +682,23 @@ static object Cyc_is_char(object o){
|
|||
return boolean_t;
|
||||
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) {
|
||||
if (!nullp(o) && !is_value_type(o) && type_of(o) == eof_tag)
|
||||
return boolean_t;
|
||||
|
|
|
@ -550,6 +550,7 @@
|
|||
null?
|
||||
number?
|
||||
pair?
|
||||
procedure?
|
||||
string?
|
||||
symbol?
|
||||
current-input-port
|
||||
|
|
Loading…
Add table
Reference in a new issue