Null object: Difference between revisions
Content added Content deleted
m (Added Raven code for NULL object) |
|||
Line 812: | Line 812: | ||
foo <- function(){} # function that does nothing |
foo <- function(){} # function that does nothing |
||
foo() # returns NULL</lang> |
foo() # returns NULL</lang> |
||
=={{header|Racket}}== |
|||
"null", or its literal form "'()", is used to denote empty lists and |
|||
sometimes it is used as a generic null value. |
|||
<lang Racket> |
|||
-> null |
|||
'() |
|||
-> (null? null) |
|||
#t |
|||
-> (null? 3) |
|||
#f |
|||
</lang> |
|||
But a value that is more used as a generic "nothing" value is "#f", |
|||
false. Racket also has a void value, mostly the result of side-effect |
|||
functions. (And an undefined value.) |
|||
=={{header|Raven}}== |
=={{header|Raven}}== |