You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2010/11/16 18:58:00 UTC

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

On Tue, Nov 16, 2010 at 6:01 PM,  <fd...@apache.org> wrote:

>  filter_docids(_, _) ->
> -    throw({bad_request, "`doc_ids` member is undefined or not a
> -            list."}).
> +    throw({bad_request, "`doc_ids` member must be defined as a list"}).

result is the same, but that's definitely not what I meant.

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 8:03 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 7:59 PM, Jan Lehnardt <ja...@apache.org> wrote:
>
>> that is: if(_doc_ids === undefined || typeof(_doc_ids) !== "list")
>>
>> // actually typeof(_doc_ids) === "undefined" for the first clause
>>
>> If you can point me out to me that a defined list could also be
>> undefined, I'm happy to accept your wording :)
>>
> I don't say that . I said that doc_ids could be undefined or not a
> list which is wrong. eg. someone didn't fill the body, gave an object,
> a string, etc. I'm speaking about the current state of the doc_ids
> variable not about what we expect it should be. That's the difference
> between 2 sentences.
>

but anyway. I'm not against the change, just wanted to state that is
wasn't what I meant. and I really prefer to be descriptive.

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 7:59 PM, Jan Lehnardt <ja...@apache.org> wrote:

> that is: if(_doc_ids === undefined || typeof(_doc_ids) !== "list")
>
> // actually typeof(_doc_ids) === "undefined" for the first clause
>
> If you can point me out to me that a defined list could also be
> undefined, I'm happy to accept your wording :)
>
I don't say that . I said that doc_ids could be undefined or not a
list which is wrong. eg. someone didn't fill the body, gave an object,
a string, etc. I'm speaking about the current state of the doc_ids
variable not about what we expect it should be. That's the difference
between 2 sentences.

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Jan Lehnardt <ja...@apache.org>.
On 16 Nov 2010, at 19:55, Benoit Chesneau wrote:

> On Tue, Nov 16, 2010 at 7:45 PM, Jan Lehnardt <ja...@apache.org> wrote:
>> 
>> On 16 Nov 2010, at 19:36, Benoit Chesneau wrote:
>> 
>>> On Tue, Nov 16, 2010 at 7:28 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>>>> On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
>>>> <fd...@apache.org> wrote:
>>> s a list, you are less descriptive.
>>>>>> 
>>>>> 
>>>>> If it's not defined than it's definitely not a list. Does it make sense?
>>>> I didn't say that your sentence didn't have sense. But I meant to be
>>>> more descriptive. Afterall that's the reason you want to use ===
>>>> rather than == in js.
>>>> 
>>> 
>>> To be clear , I prefer to give all reasons why this error happened
>>> rather than using a mind shortcut and while I'm on it maybe it could
>>> be better if i just give the right reason? The only reason I don't
>>> actually is because I wanted to use less code
>> 
>> I don't get it.
>> 
>> You said _doc_ids === undefined || typeof(_doc_ids) != List.
> 
> 
> no i said if typeof(doc_ids) === "list"

I didn't mean to use real JavaScript.

You wrote:

> `doc_ids` member is undefined or not a
> -            list."}


that is: if(_doc_ids === undefined || typeof(_doc_ids) !== "list")

// actually typeof(_doc_ids) === "undefined" for the first clause

If you can point me out to me that a defined list could also be
undefined, I'm happy to accept your wording :)

Cheers
Jan
-- 



Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 7:45 PM, Jan Lehnardt <ja...@apache.org> wrote:
>
> On 16 Nov 2010, at 19:36, Benoit Chesneau wrote:
>
>> On Tue, Nov 16, 2010 at 7:28 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>>> On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
>>> <fd...@apache.org> wrote:
>> s a list, you are less descriptive.
>>>>>
>>>>
>>>> If it's not defined than it's definitely not a list. Does it make sense?
>>> I didn't say that your sentence didn't have sense. But I meant to be
>>> more descriptive. Afterall that's the reason you want to use ===
>>> rather than == in js.
>>>
>>
>> To be clear , I prefer to give all reasons why this error happened
>> rather than using a mind shortcut and while I'm on it maybe it could
>> be better if i just give the right reason? The only reason I don't
>> actually is because I wanted to use less code
>
> I don't get it.
>
> You said _doc_ids === undefined || typeof(_doc_ids) != List.


no i said if typeof(doc_ids) === "list"

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Jan Lehnardt <ja...@apache.org>.
On 16 Nov 2010, at 19:36, Benoit Chesneau wrote:

> On Tue, Nov 16, 2010 at 7:28 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
>> <fd...@apache.org> wrote:
> s a list, you are less descriptive.
>>>> 
>>> 
>>> If it's not defined than it's definitely not a list. Does it make sense?
>> I didn't say that your sentence didn't have sense. But I meant to be
>> more descriptive. Afterall that's the reason you want to use ===
>> rather than == in js.
>> 
> 
> To be clear , I prefer to give all reasons why this error happened
> rather than using a mind shortcut and while I'm on it maybe it could
> be better if i just give the right reason? The only reason I don't
> actually is because I wanted to use less code

I don't get it.

You said _doc_ids === undefined || typeof(_doc_ids) != List.

Which reads _doc_ids must not be undefined or must me a List.

Filipe made it _doc_ids must be a List (implying they need to be defined, because if it's a List, it's also defined). I actually think Filipe's version is more clear (no offense :).

Cheers
Jan
-- 



Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Filipe David Manana <fd...@apache.org>.
I don't understand. What do the operators == and === have to do with
an error message targeted to the user?
Complaining that the doc_ids parameter is not defined as a list, isn't
explicit enough? (which means it's undefined, a string, an integer, or
whatever)


On Tue, Nov 16, 2010 at 6:36 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 7:28 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
>> <fd...@apache.org> wrote:
> s a list, you are less descriptive.
>>>>
>>>
>>> If it's not defined than it's definitely not a list. Does it make sense?
>> I didn't say that your sentence didn't have sense. But I meant to be
>> more descriptive. Afterall that's the reason you want to use ===
>> rather than == in js.
>>
>
> To be clear , I prefer to give all reasons why this error happened
> rather than using a mind shortcut and while I'm on it maybe it could
> be better if i just give the right reason? The only reason I don't
> actually is because I wanted to use less code
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 7:28 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
> <fd...@apache.org> wrote:
s a list, you are less descriptive.
>>>
>>
>> If it's not defined than it's definitely not a list. Does it make sense?
> I didn't say that your sentence didn't have sense. But I meant to be
> more descriptive. Afterall that's the reason you want to use ===
> rather than == in js.
>

To be clear , I prefer to give all reasons why this error happened
rather than using a mind shortcut and while I'm on it maybe it could
be better if i just give the right reason? The only reason I don't
actually is because I wanted to use less code

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 7:19 PM, Filipe David Manana
<fd...@apache.org> wrote:
> On Tue, Nov 16, 2010 at 6:16 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Tue, Nov 16, 2010 at 7:04 PM, Filipe David Manana
>> <fd...@apache.org> wrote:
>>> what did you meant?
>>>
>>> On Tue, Nov 16, 2010 at 5:58 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>>>> On Tue, Nov 16, 2010 at 6:01 PM,  <fd...@apache.org> wrote:
>>>>
>>>>>  filter_docids(_, _) ->
>>>>> -    throw({bad_request, "`doc_ids` member is undefined or not a
>>>>> -            list."}).
>>>>> +    throw({bad_request, "`doc_ids` member must be defined as a list"}).
>>>>
>>>> result is the same, but that's definitely not what I meant.
>>>>
>> that's the member was undefined or not a list. I you say that's the
>> member must be defined as a list, you are less descriptive.
>>
>
> If it's not defined than it's definitely not a list. Does it make sense?
I didn't say that your sentence didn't have sense. But I meant to be
more descriptive. Afterall that's the reason you want to use ===
rather than == in js.

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Filipe David Manana <fd...@apache.org>.
On Tue, Nov 16, 2010 at 6:16 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 7:04 PM, Filipe David Manana
> <fd...@apache.org> wrote:
>> what did you meant?
>>
>> On Tue, Nov 16, 2010 at 5:58 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>>> On Tue, Nov 16, 2010 at 6:01 PM,  <fd...@apache.org> wrote:
>>>
>>>>  filter_docids(_, _) ->
>>>> -    throw({bad_request, "`doc_ids` member is undefined or not a
>>>> -            list."}).
>>>> +    throw({bad_request, "`doc_ids` member must be defined as a list"}).
>>>
>>> result is the same, but that's definitely not what I meant.
>>>
> that's the member was undefined or not a list. I you say that's the
> member must be defined as a list, you are less descriptive.
>

If it's not defined than it's definitely not a list. Does it make sense?



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Nov 16, 2010 at 7:04 PM, Filipe David Manana
<fd...@apache.org> wrote:
> what did you meant?
>
> On Tue, Nov 16, 2010 at 5:58 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>> On Tue, Nov 16, 2010 at 6:01 PM,  <fd...@apache.org> wrote:
>>
>>>  filter_docids(_, _) ->
>>> -    throw({bad_request, "`doc_ids` member is undefined or not a
>>> -            list."}).
>>> +    throw({bad_request, "`doc_ids` member must be defined as a list"}).
>>
>> result is the same, but that's definitely not what I meant.
>>
that's the member was undefined or not a list. I you say that's the
member must be defined as a list, you are less descriptive.

Re: svn commit: r1035694 - /couchdb/trunk/src/couchdb/couch_changes.erl

Posted by Filipe David Manana <fd...@apache.org>.
what did you meant?

On Tue, Nov 16, 2010 at 5:58 PM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Nov 16, 2010 at 6:01 PM,  <fd...@apache.org> wrote:
>
>>  filter_docids(_, _) ->
>> -    throw({bad_request, "`doc_ids` member is undefined or not a
>> -            list."}).
>> +    throw({bad_request, "`doc_ids` member must be defined as a list"}).
>
> result is the same, but that's definitely not what I meant.
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."