unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Tom Breton \(Tehom\)" <tehom@panix.com>
Cc: emacs-devel@gnu.org
Subject: Re: ewoc patch
Date: Thu, 10 Dec 2009 02:28:17 -0500	[thread overview]
Message-ID: <jwvr5r38f7t.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <08698ba442eec12008bede6987588958.squirrel@mail.panix.com> (Tom Breton's message of "Wed, 9 Dec 2009 23:52:56 -0500")

> How do you prefer to handle the part of the ewoc-create interface that
> gives separator?  I can see several ways of proceeding:
>  * Add another optional argument.  So there'd be both "nosep" and
>    "separator"
>    * Con: It's ugly to have 2 arguments with strongly overlapping
>      meanings.
>    * Con: Confusing if the given arguments disagree.
>  * Replace argument "nosep" with "separator"
>    * Con: Breaks backward compatibility.
>    * Pro: Suffices to control all the variability
>  * Keep only "nosep" as an argument.
>    * Con: The flexibility is not available, though it exists internally.
>  * Provide two function signatures; maybe name the other
>    `ewoc-create*'.
>    * Con: Makes the interface a little bigger.

Keep only `separator', but with the added twist that a non-string,
non-nil argument means the empty string (aka mean "nosep").  That should
preserve backward compatibility with a mostly clean API.

>>>> The Emacs package generally doesn't like version numbers, so I'd rather
>>>> not introduce one here, unless there's really a good reason for it.
>>> I added it so that other packages that wanted or needed a variable
>>> separator could tell whether it was available.  Otherwise they would
>>> make
>>> errors if an old ewoc.el was loaded.  If you have a better way in mind,
>>> I'll use it.
>> Better just try to use the feature and detect when it's not available.
>> E.g. check the feature's presence via `fboundp' or by trying the call
>> with the extra parametwer and catch the
>> `wrong-number-of-arguments' error.
> I'm not sure that would suffice.  ewoc-create is fbound in any case.  That
> leaves us with trying ewoc-create and catching the error.  My fear is that
> a client's call to ewoc-create would not naturally occur at a good time
> for this.  Ie, a client would appear to load correctly, would be started
> by the user, and only then realize that it was relying on something that
> wasn't available.

I think you're worrying for no good reason.  If you really want to
handle version dependencies right, you don't want it in a Lisp variable
but in a header understood and processed by some package manager (ELPA,
for instace).  Otherwise, you'll have to deal (one way or another) with
runtime checks, and in most cases the calling package will simply not
work with an older version.


        Stefan




  reply	other threads:[~2009-12-10  7:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09  4:03 ewoc patch Tom Breton (Tehom)
2009-12-09  4:19 ` ewoc patch (Was wrong patch, right one attached) Tom Breton (Tehom)
2009-12-09  4:40 ` ewoc patch Stefan Monnier
2009-12-09 20:57   ` Tom Breton (Tehom)
2009-12-09 21:25     ` Stefan Monnier
2009-12-10  4:52       ` Tom Breton (Tehom)
2009-12-10  7:28         ` Stefan Monnier [this message]
2009-12-11  1:23           ` Tom Breton (Tehom)
2009-12-11  5:09             ` Stefan Monnier
2010-08-21 10:52             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr5r38f7t.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=tehom@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).