Skip to content

Instantly share code, notes, and snippets.

@vibhavp
Created March 28, 2015 11:17
Show Gist options
  • Save vibhavp/2bd8afcac70fad018cd8 to your computer and use it in GitHub Desktop.
Save vibhavp/2bd8afcac70fad018cd8 to your computer and use it in GitHub Desktop.
static object_t *call_predicate(object_t *obj, predicate_t pred)
{
switch(pred)
{
case INTEGER_P:
return PRED_BOOL_OBJ(_INTEGER_P(obj));
case FLOAT_P:
return PRED_BOOL_OBJ(_FLOAT_P(obj));
case NUMBER_P:
return PRED_BOOL_OBJ(_NUMBER_P(obj));
case STRING_P:
return PRED_BOOL_OBJ(_STRING_P(obj));
case SYMBOL_P:
return PRED_BOOL_OBJ(_SYMBOL_P(obj));
case LIST_P:
return PRED_BOOL_OBJ(_LIST_P(obj));
case LAMBDA_P:
return PRED_BOOL_OBJ(_LAMBDA_P(obj));
}
/*The control will never reach here*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment