Re: Docstring as only form in a function

2014-02-26 Thread Mark H Weaver
Hi Arne, Arne Babenhauserheide writes: > I think it would be more consistent to have the first form of the body > double as a docstring if it is a string. I agree with others that this is a very bad idea, and would encourage you to change your habits. However, for the sake of showing how easy i

Re: Docstring as only form in a function

2014-02-20 Thread Taylan Ulrich Bayırlı/Kammer
Arne Babenhauserheide writes: > What do you think? I don't have a strong opinion at all, since this feels like a bikesheddy issue, but I think the current behavior is more preferable. A lambda form cannot have an empty body, and having a docstring shouldn't change that, so I would expect (lambd

Re: Docstring as only form in a function

2014-02-20 Thread Panicz Maciej Godek
2014-02-20 17:59 GMT+01:00 Arne Babenhauserheide : > Hi, > > I recently experimented with docstrings, and I stumbled over not being > able to define a function which only has a docstring as body: > > > (define (foo) > "bar") > > (procedure-documentation foo) > => #f > > Adding a f

Re: Docstring as only form in a function

2014-02-20 Thread Neil Jerram
On 2014-02-20 16:59, Arne Babenhauserheide wrote: Hi, I recently experimented with docstrings, and I stumbled over not being able to define a function which only has a docstring as body: (define (foo) "bar") (procedure-documentation foo) ⇒ #f Adding a form makes the string

Docstring as only form in a function

2014-02-20 Thread Arne Babenhauserheide
Hi, I recently experimented with docstrings, and I stumbled over not being able to define a function which only has a docstring as body: (define (foo) "bar") (procedure-documentation foo) ⇒ #f Adding a form makes the string act as docstring: (define (foo) "ba