File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ pub(crate) fn symbolp(object: Object) -> bool {
167
167
pub ( crate ) fn functionp ( object : Object ) -> bool {
168
168
match object. untag ( ) {
169
169
ObjectType :: ByteFn ( _) | ObjectType :: SubrFn ( _) => true ,
170
- ObjectType :: Cons ( cons) => cons. car ( ) == sym:: CLOSURE ,
170
+ ObjectType :: Cons ( cons) => cons. car ( ) == sym:: CLOSURE || cons . car ( ) == sym :: LAMBDA ,
171
171
ObjectType :: Symbol ( sym) => sym. has_func ( ) ,
172
172
_ => false ,
173
173
}
@@ -519,6 +519,7 @@ unsafe impl Sync for LispError {}
519
519
#[ cfg( test) ]
520
520
mod test {
521
521
use super :: * ;
522
+ use crate :: interpreter:: assert_lisp;
522
523
523
524
#[ test]
524
525
fn test_ash ( ) {
@@ -528,6 +529,11 @@ mod test {
528
529
assert_eq ! ( ash( 256 , -8 ) , 1 ) ;
529
530
assert_eq ! ( ash( -8 , 1 ) , -16 ) ;
530
531
}
532
+
533
+ #[ test]
534
+ fn test_functionp ( ) {
535
+ assert_lisp ( "(functionp '(lambda nil))" , "t" ) ;
536
+ }
531
537
}
532
538
533
539
defsym ! ( MANY ) ;
You can’t perform that action at this time.
0 commit comments