Skip to content

Commit

Permalink
squash with fun tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Jun 27, 2024
1 parent 5fbca20 commit 146f550
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PreSmalltalks-Pharo/Integer.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Extension { #name : #Integer }
{ #category : #'*PreSmalltalks-Pharo' }
Integer >> factorialHylomorphically [
self < 0 ifTrue: [self error: 'Not valid for negative integers'].
^(1 to: self) "anamorphism"
inject: 1 into: #* "catamorphism"
^(1 to: self) "anamorphism: unfold scalar to an inductive datatype"
inject: 1 into: #* "catamorphism: fold inductive datatype to scalar"
]

0 comments on commit 146f550

Please sign in to comment.