7

I am using Emacs with SLIME for my development environment. When I type (write-to and then C-M-i I get the following autocompletions:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
write-to-sting
write-to-string

I know Common Lisp is powerful, but I guess write-to-sting is not in the ANSI standard. Google didn't offer a single hit for this function. Then I tried to find it in the SBCL code, but alas

(documentation 'write-to-sting 'function) returns nil so it doesn't have a documentation string.

When I try to execute the function (write-to-sting) I get The function COMMON-LISP-USER::WRITE-TO-STING is undefined.

Apropos also finds an unbound function:

(apropos 'write-to)
WRITE-TO
WRITE-TO-STING
WRITE-TO-STRING (fbound)

My question is: What is going on? Does anyone knows the story behind this function?

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
anonymous
  • 1,522
  • 14
  • 24

1 Answers1

9

At some point during your interaction with the Lisp environment, you wrote write-to-sting and it was read by the Lisp reader. The symbol was interned in the COMMON-LISP-USER package. After all, maybe you intended to implement a function that sends an email to Sting, who knows? Auto-completion works by filtering the currently known symbols in the environment.

You can safely (unintern 'write-to-sting) (or implement it).

coredump
  • 37,664
  • 5
  • 43
  • 77
  • 1
    *facepalm* I did the following test: I wrote (blablabla), exited the debugger and then (apropos 'bla) showed the function... So you are correct - mistyping the function interns the mistyped version... – anonymous Sep 27 '16 at 07:37