mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 19:56: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 '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")
|
||||||
|
|
17
runtime.h
17
runtime.h
|
@ -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;
|
||||||
|
|
|
@ -550,6 +550,7 @@
|
||||||
null?
|
null?
|
||||||
number?
|
number?
|
||||||
pair?
|
pair?
|
||||||
|
procedure?
|
||||||
string?
|
string?
|
||||||
symbol?
|
symbol?
|
||||||
current-input-port
|
current-input-port
|
||||||
|
|
Loading…
Add table
Reference in a new issue