all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: featurep
Date: 19 Mar 2002 14:39:37 +0100	[thread overview]
Message-ID: <5xg02wd6cm.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <200203190844.g2J8iOq09224@wijiji.santafe.edu>

Richard Stallman <rms@gnu.org> writes:

> I agree with the people who say this is not very clean:
> 
>   The following special call returns t iff a given KEY VALUE
>   pair is supported on this system:
> !   (make-network-process :feature KEY VALUE)
> 
> Couldn't this be done with featurep, using sub-features?
> Please try to design it that way.

I agree that it would be cleaner (in a purist sense) to have this work
through featurep, and technically there is nothing (serious) preventing
this from working.

However, for a usage point of view, I don't really see why it
matters, and IMHO, using featurep will be _less_ intuitive.
For example, I think using

  (if (and (make-network-process :feature :family 'local)
           (make-network-process :feature :datagram t))
        
to test whether make-network-process supports datagrams and the local
sockets is a lot easier to use (since those are the exact same
arguments which are used to select those features) than to test on
some similar, but not quite the same, symbols like

  (if (and (featurep 'networking 'local-sockets)
           (featurep 'networking 'datagrams))

To take this further, you can test whether a give socket option
is supported (without adding extra code at the C-level) with

  (if (make-network-process :feature :options 'oobinline)

whereas doing the same with featurep requires adding more
symbols and code to be able to say something like

  (if (featurep 'networking 'oobinline-option)

In fact, what you are asking is that I invent slightly different names
for all the various combinations of arguments to make-network-process,
just for the purpose of being able to use a standard way to test for
the availablility of those features.

Actually, if you accept to leave in the :featurep argument,
it would be possible to do this at the lisp level using code
like this:

  (let ((subfeatures nil))
     (if (make-network-process :featurep :datagram t)
        (setq subfeatures (cons 'datagrams subfeatures)))
     (if (make-network-process :featurep :family local)
        (setq subfeatures (cons 'local-sockets subfeatures)))
     (if (make-network-process :featurep :options 'oobinline)
        (setq subfeatures (cons 'oobinline-option subfeatures)))
     ;; etc...
     (provide 'networking subfeatures))
     

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


       reply	other threads:[~2002-03-19 13:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200203190844.g2J8iOq09224@wijiji.santafe.edu>
2002-03-19 13:39 ` Kim F. Storm [this message]
2002-03-19 19:24   ` featurep Jason Rumney
2002-03-19 21:20     ` featurep Stefan Monnier
2002-03-19 23:09       ` featurep Kim F. Storm
2002-03-19 23:19         ` featurep Stefan Monnier
2002-03-19 23:48           ` featurep Kim F. Storm
2002-03-20  0:03             ` featurep Stefan Monnier
2002-03-19 22:59     ` featurep Kim F. Storm
2002-03-21  9:04     ` featurep Richard Stallman
2002-03-21 13:12       ` featurep Kim F. Storm
2002-03-23  2:35         ` featurep Richard Stallman
2002-03-21 16:44       ` featurep Stefan Monnier
2002-03-21 19:47         ` featurep Kim F. Storm
2002-03-22  0:39           ` featurep Stefan Monnier
2002-03-22  9:14             ` featurep Kim F. Storm

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

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

  git send-email \
    --in-reply-to=5xg02wd6cm.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /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 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.