We can define a new function like this:
(define (car x y) (+ x y))
And use car
as an add function. Meanwhile, we lost the built-in function car
. Why does Racket allow this? How could we recover the lost built-in function, here is car
.
We can define a new function like this:
(define (car x y) (+ x y))
And use car
as an add function. Meanwhile, we lost the built-in function car
. Why does Racket allow this? How could we recover the lost built-in function, here is car
.
Definitions affect the current module only (and, if you export your definition, then any other modules that import your module). You can always import Racket's built-in functions under a different name, if you want to use
car
in your module for something else. For example:Now, you can use
racket-car
to refer to the built-incar
function.