summaryrefslogtreecommitdiff
path: root/coding-exercises/2/83.rkt
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-05-03 09:19:18 +0200
committerMike Vink <mike1994vink@gmail.com>2023-05-03 09:19:18 +0200
commit3fdd0f8042574874a34999291e00cb550cf91e2d (patch)
tree5e32ebdd2a1cd34203d5b04921ddd5ee66b47b48 /coding-exercises/2/83.rkt
parent07286656104cfdab4004eae4d02fbe1f6c2ace21 (diff)
refactor to use arithmetic package for working with polys
Diffstat (limited to 'coding-exercises/2/83.rkt')
-rw-r--r--coding-exercises/2/83.rkt1
1 files changed, 1 insertions, 0 deletions
diff --git a/coding-exercises/2/83.rkt b/coding-exercises/2/83.rkt
index bba4a57..502aadc 100644
--- a/coding-exercises/2/83.rkt
+++ b/coding-exercises/2/83.rkt
@@ -331,6 +331,7 @@
;; So we are going to add these generic operations to the complex package.
;; NOTE(mike): mixed types are not supported in my system, but they could be if we use the raising apply generic probably!
;; for example we can mul a real and rational with the raising applier
+;; in a tower of types you could also define some methods only for types where other types can be raised to, but this puts the burden on the type hierarchy.
(apply-and-drop 'angle (make-complex-rect test-rat test-rat))
(apply-and-drop 'magnitude (make-complex-rect test-rat test-rat))
(apply-and-drop 'real-part (make-complex-polar test-rat test-rat))