Skip to content

Commit

Permalink
Mutate objects (kputnam#65 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
casconed committed Oct 8, 2023
1 parent 1ef35c3 commit ff4406a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ruby/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Refinements
#
# @return [Array]
def cons(array = [])
[self] + array
array.unshift(self)
end

# Append the item to rear of a new list
Expand All @@ -26,7 +26,7 @@ def cons(array = [])
#
# @return [Array]
def snoc(array = [])
array + [self]
array.push(self)
end

# @group Combinators
Expand Down

0 comments on commit ff4406a

Please sign in to comment.