summaryrefslogtreecommitdiff
path: root/coding-exercises/2/77.rkt
diff options
context:
space:
mode:
authorMike Vink <>2023-04-18 23:47:17 +0200
committerMike Vink <>2023-04-18 23:47:17 +0200
commit6d9a546f69023788d1b04fbd4722874466c3891d (patch)
treeef0833582058ea0e314d3b42611c1edaeca9e12c /coding-exercises/2/77.rkt
parent6643d15b64d4ab0f72a7cd29458fb2cbecd02e2b (diff)
fixup
Diffstat (limited to 'coding-exercises/2/77.rkt')
-rw-r--r--coding-exercises/2/77.rkt9
1 files changed, 9 insertions, 0 deletions
diff --git a/coding-exercises/2/77.rkt b/coding-exercises/2/77.rkt
new file mode 100644
index 0000000..65feaf3
--- /dev/null
+++ b/coding-exercises/2/77.rkt
@@ -0,0 +1,9 @@
+#lang racket
+
+;; (apply-generic 'magnitude z)
+;; This strips the complex type-tag from z and passes the contents to the generic magnitude procedure defined in the complex package.
+;; The magnitude procedure is responsible for dispatching the operation to the magnitude procedure of either the rectangular or the polar form representation.
+;; (apply-generic 'magnitude z)
+;; This strips away the rectangular type tag of the args and passes the contents of the args to the corresponding 'magnitude '(rectangular) procedure.
+;; In the end the rectangular magnitude procedure's return value is bubbled up to the calling function.
+(print "hi")