all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
       [not found] ` <20161025103309.77C982201D5@vcs.savannah.gnu.org>
@ 2016-10-25 13:53   ` Stefan Monnier
  2016-10-25 14:23     ` Damien Cassou
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2016-10-25 13:53 UTC (permalink / raw)
  To: emacs-devel; +Cc: Damien Cassou

> +Return nil if SEQUENCE is nil."
> +  (if (seq-empty-p sequence)
> +      (error "Sequence cannot be empty")

Hmm... which is it?


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
  2016-10-25 13:53   ` [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el Stefan Monnier
@ 2016-10-25 14:23     ` Damien Cassou
  2016-10-25 14:26       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Damien Cassou @ 2016-10-25 14:23 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +Return nil if SEQUENCE is nil."
>> +  (if (seq-empty-p sequence)
>> +      (error "Sequence cannot be empty")
>
> Hmm... which is it?

I'm not sure I understand your question. I could have written:

    (error "Sequence %s cannot be empty" sequence)

but I thought it was useless because SEQUENCE is empty and nothing
meaningful would be added to the message.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
  2016-10-25 14:23     ` Damien Cassou
@ 2016-10-25 14:26       ` Stefan Monnier
  2016-10-25 14:48         ` Tino Calancha
  2016-10-25 15:07         ` Nicolas Petton
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2016-10-25 14:26 UTC (permalink / raw)
  To: emacs-devel

>>> +Return nil if SEQUENCE is nil."
>>> +  (if (seq-empty-p sequence)
>>> +      (error "Sequence cannot be empty")
>> 
>> Hmm... which is it?

> I'm not sure I understand your question.

The question was: should I obey the docstring or the code?


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
  2016-10-25 14:26       ` Stefan Monnier
@ 2016-10-25 14:48         ` Tino Calancha
  2016-10-25 15:05           ` Nicolas Petton
  2016-10-25 15:07         ` Nicolas Petton
  1 sibling, 1 reply; 6+ messages in thread
From: Tino Calancha @ 2016-10-25 14:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel



On Tue, 25 Oct 2016, Stefan Monnier wrote:

>>>> +Return nil if SEQUENCE is nil."
>>>> +  (if (seq-empty-p sequence)
>>>> +      (error "Sequence cannot be empty")
>>>
>>> Hmm... which is it?
>
>> I'm not sure I understand your question.
>
> The question was: should I obey the docstring or the code?
The code, always the code.

Indeed, pretty consistent, after all this function is about getting a 
_random_ element from a sequence; if the doc string assures something 
opposite as the code, then it's very hard to predict the result of the 
coin flipping experiment, regardless of which is the underline random 
generation engine.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
  2016-10-25 14:48         ` Tino Calancha
@ 2016-10-25 15:05           ` Nicolas Petton
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Petton @ 2016-10-25 15:05 UTC (permalink / raw)
  To: Tino Calancha, Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Tino Calancha <tino.calancha@gmail.com> writes:

>> The question was: should I obey the docstring or the code?
> The code, always the code.

Indeed!

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el
  2016-10-25 14:26       ` Stefan Monnier
  2016-10-25 14:48         ` Tino Calancha
@ 2016-10-25 15:07         ` Nicolas Petton
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Petton @ 2016-10-25 15:07 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel; +Cc: Damien Cassou

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

> The question was: should I obey the docstring or the code?

I fixed the docstring.

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-25 15:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20161025103309.2182.7179@vcs.savannah.gnu.org>
     [not found] ` <20161025103309.77C982201D5@vcs.savannah.gnu.org>
2016-10-25 13:53   ` [Emacs-diffs] master bd22beb: Add seq-random-elt to seq.el Stefan Monnier
2016-10-25 14:23     ` Damien Cassou
2016-10-25 14:26       ` Stefan Monnier
2016-10-25 14:48         ` Tino Calancha
2016-10-25 15:05           ` Nicolas Petton
2016-10-25 15:07         ` Nicolas Petton

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.