Skip to content

Commit

Permalink
Map CommonLisp nil to Ruby nil instead of false.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 8, 2022
1 parent 0aef20a commit 7308c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sxp/reader/common_lisp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read_atom
when DECIMAL then Float(buffer) # FIXME?
when INTEGER then Integer(buffer)
when /^t$/i then true
when /^nil$/i then false
when /^nil$/i then nil
else buffer.to_sym
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/common_lisp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
{
't' => true,
'T' => true,
'nil' => false,
'NIL' => false,
'nil' => nil,
'NIL' => nil,
'1/2' => Rational(1, 2),
'1.0' => Float(1.0),
"10" => Integer(10),
Expand Down

0 comments on commit 7308c3e

Please sign in to comment.