Skip to content

Commit

Permalink
Add Product>>⨰
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Oct 14, 2023
1 parent 54c407c commit d9c6186
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MachineArithmetic-MathNotation/Object.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Object >> ≅ [ anObject
Object >> ⊛ [ Fa
^Fa collect: self
]

{ #category : #'*MachineArithmetic-MathNotation' }
Object >> ⨰ [ rhs
^(Product with: self) ⨰ rhs
]
8 changes: 8 additions & 0 deletions MachineArithmetic-MathNotation/Product.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ Product >> ≅ [ rhs
self = rhs ifTrue: [^true].
^self = (Product with: rhs)
]

{ #category : #monoid }
Product >> ⨰ [ C
"Non-associative version of #×.
This is useful, for example, when deserializing data coming on the wire
from ML, because in ML, (string*string)*string ≠ string*(string*string)."
^self, (Product with: C)
]

0 comments on commit d9c6186

Please sign in to comment.