#lang racket
; implement add without + operator
(define add
(λ (n m)
(cond
((zero? m) n)
(else (add1
(add n (sub1
m)))))))
One thing I want to notice is that add1 and sub1 are not what I defined myself.
https://www.youtube.com/watch?v=1lBadANnJaw
No comments:
Post a Comment