How do namespaces work in Chicken Scheme? I am now using the parley
egg, and when I define a function with the name e.g. read
, that causes an error because of name clashing (actually, because my read
overwrites parley
's own read
, and it is invoked with wrong type.
Here's the code:
(use parley)
(define (read p) p) ; This `read` function conflicts.
(let loop ((l (parley "> ")))
(if (or (eof-object? l)
(equal? l "quit"))
(print "bye!")
(begin
(printf "you typed: ~s~%" l)
(loop (parley "> ")))))
How can I avoid collisions like these?
UPDATE
I've reduced the code necessary to reproduce this:
(use parley)
(define (read p) p)
this gets the following error:
Error: illegal non-atomic object: #<input port "readline.scm">
Obviously, my read
function is clashing with parley
read
. But I don't know how to avoid this without renaming my function.