From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Opaque objects and Emacs documentation Date: Wed, 22 Jul 2020 18:44:18 +0300 Message-ID: <1d2e5168-d69a-147a-8905-61af2d0b4379@yandex.ru> References: <20200712184908.13140.5739@vcs0.savannah.gnu.org> <20200712184909.BBC61209B1@vcs0.savannah.gnu.org> <7bf4d6ef-c0ec-43dc-ad5d-f6e81422ad90@yandex.ru> <83zh84m5ws.fsf@gnu.org> <3dd1c224-69b2-40af-5b2e-43a310253632@yandex.ru> <83tuybmtxs.fsf@gnu.org> <859f594b-1343-6d26-e1ac-7157c44eb56c@yandex.ru> <83a6zyk4tt.fsf@gnu.org> <6edffb7d-7708-534f-93ad-bf9180f5e0ed@yandex.ru> <835zamjsvk.fsf@gnu.org> <831rlajock.fsf@gnu.org> <1fcdc463-b3ab-2d32-31d7-904783ae0d81@yandex.ru> <83y2nii6sk.fsf@gnu.org> <69716ecb-8984-23e0-8b44-322ea3582384@yandex.ru> <837duxgcmw.fsf@gnu.org> <83wo2wfytr.fsf@gnu.org> <70c95ed1-cf68-32c6-49a9-6ed67f20b4c9@yandex.ru> <83imeffwth.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 22 17:45:30 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyGvw-000A9A-OK for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jul 2020 17:45:28 +0200 Original-Received: from localhost ([::1]:35220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyGvv-00028C-Qc for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jul 2020 11:45:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyGuz-0001J9-4b for emacs-devel@gnu.org; Wed, 22 Jul 2020 11:44:29 -0400 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:33908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyGuw-0006hy-HN; Wed, 22 Jul 2020 11:44:28 -0400 Original-Received: by mail-wr1-x42d.google.com with SMTP id f7so2385942wrw.1; Wed, 22 Jul 2020 08:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vkWbQZ8MIhCq4AC6FOLb6uVhEx+DxSarzFeaFgSSWVw=; b=jSKJ33l7Ybuq0LRQ+/xxZ5S1yumfpxJK1Oik0iAWR9vYrqydWqwY2oyyx2GWx4r6B/ JudM4cQ8Du7l27mUTKAqhC0uXVDrFDZ5eatV38z4mki1GP1yqDZW5LymN0cTuH4K1owd zvwMJbSy1qOILgSQATF8muNlm+qC99hyuBypfGZlScCCTqHQUqfsESvySwXHicA0gkqO ccjL5fp/6ydyctVHVzg5EUVE9azrFC2UPE35cgx9uh3CeeppQaNkbDh9Z1gLWuIEwIin AtS5p4wS49heOVM03vTLmz+vCcQEUzZ5upANiRRWf0or2c2L3QpM269DlcUUG7k5VlRZ TMdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vkWbQZ8MIhCq4AC6FOLb6uVhEx+DxSarzFeaFgSSWVw=; b=c4XVAYOmOOJXM8YIg1HusqQDtik4JrCMtrsJapq/OX/v+NOkW4E7/Is8dIyJHBM7If bcKwLLgxGSclsfeVz1JJw0PxacoQY52Q6Ox0LBcPAIOMM5emn5MEVONXoR14EiQyQsAX LGSD0pbXQULEIjpIruXe3zlNDjDGs4M10radRJrGWNqfWywL4z1VGmTAJZubnLbCzkg5 MVPftG1cAv3MV60b9EJFcc7p0JYpGr+6JksRD930Ek5B1hAwD0yQG+VahB8F/pzWBhBS 0HtjdvnTipxEGeDUZ35HK+fcTauwTOEfYYg0zkRxQx7vSaX3xDLnH8BbVfnM0dwRavzA t1Sw== X-Gm-Message-State: AOAM531jHdi6/QUQVjqC9xvSHxU8f56Hfa7hOJ5C12sjDIj509doVJDR JVFob2DlbZkZboBOWeW5ogXe+qrm X-Google-Smtp-Source: ABdhPJwEib+XDy2lQWBuCffODrE2BhDZu7pUMPwPSfehyUlxHSxlzeaUMpbVi+nhRQth9BHBAJzx6Q== X-Received: by 2002:adf:fc90:: with SMTP id g16mr199098wrr.42.1595432660602; Wed, 22 Jul 2020 08:44:20 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id 65sm116978wmd.20.2020.07.22.08.44.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jul 2020 08:44:19 -0700 (PDT) In-Reply-To: <83imeffwth.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253161 Archived-At: On 22.07.2020 17:28, Eli Zaretskii wrote: >>>> If you say that, could you give an example of something that *would* be >>>> an impediment to extensibility? >>> >>> What you said: describing what generics returns, or what >>> project-current returns in general. >> >> No, describing "in general" is good. What is bad is describing "in >> particular" when a function is "general" and can return values that are >> different from the examples. project-current is "general". > > That's because "general" is overloaded, and you understand it in a > sense different from the one in which I used it. Just drop "in > general" from what I wrote, and you will have a much better > approximation to what I meant. If I drop both instances of the word "general" from the sentence I quoted, there will be nothing left. Perhaps you can read my description and learn something new from it? >> And speaking of "transient", it's not helpful to say it returns a cons >> (transient . root) because that doesn't say anything about the project >> behavior anyway (which is the important part). > > A backend that receives such an object will need to be prepared for > it. The backend returned that value, so it is surely prepared. >>> If those are the rules of the game, yes. IOW, if it's not okay to >>> describe the possible forms of the object in the doc string of >>> project-find-functions, but okay to describe them in the individual >>> doc strings of each hook that can be put there, then it could be an >>> acceptable compromise, at least from my POV. >> >> Very well. The "transient" project is not on the hook, though. > > Yes, but the code which returns it is a kind of "default > implementation" for bootstrapping projects. So it is definitely in > the same class of objects as the vc project. Yes. If the same class as "shouldn't be documented in too much detail in project-current or project-find-functions". >>>> Right. But there won't be any third-party callers of project-try-vc, >>>> this function's only purpose is to be inside project-find-functions. >>> >>> I'm thinking about additional "authors" who'd like to add >>> functionality to existing project backends. >> >> They won't call it either. If they do, the function is likely to have >> changed significantly from its current state. > > Even if they don't call it (and I'm unconvinced), they will need to > deal with the return value, so some documentation about it will be > useful. The function ends with (cons 'vc root). Is there really much uncertainty about what kind of value is returns? >>>> No disagreement there, as long as we're talking about public functions. >>> >>> Are we still under the rule that any function without 2 dashes in its >>> name is public? If so, then I think we have only discussed public >>> functions in this and related threads. >> >> OK, I have a question then. Does every built-in member of a public hook >> need to be public? > > The main point here is that the particular types of objects the > existing backends produce should be documented somewhere. Check out 'M-x describe-function RET project-root RET', the "Implementations:" section.