Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstring ambiguity #367

Open
jpellegrini opened this issue May 25, 2024 · 1 comment
Open

Docstring ambiguity #367

jpellegrini opened this issue May 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jpellegrini
Copy link

jpellegrini commented May 25, 2024

Hello!

I see that lambdas may have docstrings included as their first expression, as in Common Lisp and Emacs Lisp:

(define g (lambda () "one" -1))
lips> (help g)
one

But define may also include docstrings, as an extra argument:

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:

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"?

@jcubic
Copy link
Owner

jcubic commented May 25, 2024

Yes, it's a good idea.

@jcubic jcubic added the enhancement New feature or request label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants