From d9c61863c34a6c2016fed9f955f9456fa346c6d6 Mon Sep 17 00:00:00 2001 From: Boris Shingarov Date: Sat, 14 Oct 2023 04:42:48 -0400 Subject: [PATCH] =?UTF-8?q?Add=20Product>>=E2=A8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MachineArithmetic-MathNotation/Object.extension.st | 5 +++++ MachineArithmetic-MathNotation/Product.class.st | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/MachineArithmetic-MathNotation/Object.extension.st b/MachineArithmetic-MathNotation/Object.extension.st index 84867540f..b521e1ef0 100644 --- a/MachineArithmetic-MathNotation/Object.extension.st +++ b/MachineArithmetic-MathNotation/Object.extension.st @@ -23,3 +23,8 @@ Object >> ≅ [ anObject Object >> ⊛ [ Fa ^Fa collect: self ] + +{ #category : #'*MachineArithmetic-MathNotation' } +Object >> ⨰ [ rhs + ^(Product with: self) ⨰ rhs +] diff --git a/MachineArithmetic-MathNotation/Product.class.st b/MachineArithmetic-MathNotation/Product.class.st index 6ed8f807f..b9069216f 100644 --- a/MachineArithmetic-MathNotation/Product.class.st +++ b/MachineArithmetic-MathNotation/Product.class.st @@ -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) +]