Skip to content

Commit

Permalink
add jl_is_nothing predicate
Browse files Browse the repository at this point in the history
Julia C API is lacking in a predicate to check if a given value is
nothing or not. This commit includes the predicate in C macro.
  • Loading branch information
bicycle1885 committed Mar 17, 2014
1 parent 213b4b3 commit 3852357
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ extern jl_sym_t *boundscheck_sym; extern jl_sym_t *copyast_sym;
// basic predicates -----------------------------------------------------------

#define jl_is_null(v) (((jl_value_t*)(v)) == ((jl_value_t*)jl_null))
#define jl_is_nothing(v) (((jl_value_t*)(v)) == ((jl_value_t*)jl_nothing))
#define jl_is_tuple(v) jl_typeis(v,jl_tuple_type)
#define jl_is_datatype(v) jl_typeis(v,jl_datatype_type)
#define jl_is_pointerfree(t) (((jl_datatype_t*)t)->pointerfree)
Expand Down

0 comments on commit 3852357

Please sign in to comment.