I'm trying to import some functions from SBCL non-standard builtins to use with a socket. When I do this outside slime, with bare interactive shell + SBCL it works, but not in SLIME.
What I did:
(import 'sb-bsd-sockets:host-ent-address) (import 'sb-bsd-sockets:get-host-by-name) or
(use-package :sb-bsd-sockets) After doing either one, SLIME greets me with an error, saying that I'm trying to import something already in cl-user package. This is a correctable error, which I proceed to correct by choosing the symbols found in sb-bsd-sockets package. No further errors follow.
Then, when I try to compile function:
(defun nslookup (hostname) (if hostname (sb-bsd-sockets:host-ent-address (sb-bsd-sockets:get-host-by-name hostname)) nil)) It works. But if I try to compile this:
(defun nslookup-1 (hostname) (if hostname (host-ent-address (get-host-by-name hostname)) nil)) Then I get a warning about undefined functions, and an error when I try to call nslookup-1.
To my surprise, if I try doing this in REPL:
CL-USER> #'host-ent-address #<STANDARD-GENERIC-FUNCTION HOST-ENT-ADDRESS (1)> CL-USER> It "works". I.e. it knows the function, but decides not to use it...
There must be some (special?) way to either import packages into SLIME's REPL, or at least symbols from those packages, otherwise it's very inconvenient to use long names for testing and then to replace them for the actual program...