Docstring ambiguity
- Dominant language
- JavaScript
- Stars
- 507
- Forks
- 45
- Avg merge
- 11h 22m
- Merged PRs (30d)
- 4
Description
Hello!
I see that lambdas may have docstrings included as their first expression, as in Common Lisp and Emacs Lisp:
```scheme
(define g (lambda () "one" -1))
lips> (help g)
one
```
But define may also include docstrings, as an extra argument:
```scheme
lips> (define x 10 "two")
lips> (help x)
two
```
But... Then I cold also try to include a docstring inside a lambda, and define it as the value of a a variable with a different docstring:
```scheme
lips> (define f (lambda () "some docstring" -1) "a different docstring")
lips> (help f)
some docstring
```
Perhaps a warning could be issued in this case? When defining `f`, LIPS could warn the user that "the value is a procedure that already has a docstring"?
Contributor guide
Assessment
This issue has not been assessed yet.