This commit is contained in:
simon 2017-01-12 15:02:41 +00:00
parent b0ea969197
commit f64469235d

View file

@ -63,6 +63,11 @@
*/ */
#define consp(conspoint) (check_tag(conspoint,CONSTAG)) #define consp(conspoint) (check_tag(conspoint,CONSTAG))
/**
* true if conspointer points to a function cell, else false
*/
#define functionp(conspoint) (check_tag(conspoint,FUNCTIONTAG))
/** /**
* true if conspointer points to a string cell, else false * true if conspointer points to a string cell, else false
*/ */
@ -114,6 +119,11 @@ struct cons_payload {
struct cons_pointer cdr; struct cons_pointer cdr;
}; };
struct function_payload {
struct cons_pointer source;
struct cons_pointer (*executable)(struct cons_pointer, struct cons_pointer);
};
/** /**
* payload of a free cell. For the time being identical to a cons cell, * payload of a free cell. For the time being identical to a cons cell,
* but it may not be so in future. * but it may not be so in future.
@ -165,6 +175,8 @@ struct cons_space_object {
struct cons_payload cons; struct cons_payload cons;
/* if tag == FREETAG */ /* if tag == FREETAG */
struct free_payload free; struct free_payload free;
/* if tag == FUNCTIONTAG */
struct function_payload function;
/* if tag == INTEGERTAG */ /* if tag == INTEGERTAG */
struct integer_payload integer; struct integer_payload integer;
/* if tag == NILTAG; we'll treat the special cell NIL as just a cons */ /* if tag == NILTAG; we'll treat the special cell NIL as just a cons */