GNU bug report logs - #47425
26.3; `plist-get', `plist-put' should accept a TEST function

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 26 Mar 2021 22:14:01 UTC

Severity: wishlist

Found in version 26.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47425 in the body.
You can then email your comments to 47425 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Fri, 26 Mar 2021 22:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Mar 2021 22:14:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.3; `plist-get', `plist-put' should accept a TEST function
Date: Fri, 26 Mar 2021 22:13:42 +0000
Please consider adding a TEST comparer arg for plist keys.

In Elisp, a plist key need not be a symbol:

(plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)

That "works" (and no error), but it doesn't do what's expected, since
the keys should be compared with `equal' or `string=', not `eq'.

And if it were not intended that that work then Elisp would raise a
wrong-type-argument error saying that the first arg isn't a plist.

And note that the Elisp manual says:

  A "property list" ("plist" for short) is a list of
  paired elements.  Each of the pairs associates a
  property name (usually a symbol) with a property or value.
                 ^^^^^^^

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19041
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Fri, 26 Mar 2021 22:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>, "47425 <at> debbugs.gnu.org"
 <47425 <at> debbugs.gnu.org>
Subject: RE: 26.3; `plist-get', `plist-put' should accept a TEST function
Date: Fri, 26 Mar 2021 22:16:20 +0000
That would also mean we wouldn't need `lax-plist-*' functions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Sat, 27 Mar 2021 07:19:02 GMT) Full text and rfc822 format available.

Message #11 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47425 <at> debbugs.gnu.org
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Sat, 27 Mar 2021 10:16:35 +0300
* Drew Adams <drew.adams <at> oracle.com> [2021-03-27 01:15]:
> Please consider adding a TEST comparer arg for plist keys.
> 
> In Elisp, a plist key need not be a symbol:
> 
> (plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)
> 
> That "works" (and no error), but it doesn't do what's expected, since
> the keys should be compared with `equal' or `string=', not `eq'.
> 
> And if it were not intended that that work then Elisp would raise a
> wrong-type-argument error saying that the first arg isn't a plist.
> 
> And note that the Elisp manual says:
> 
>   A "property list" ("plist" for short) is a list of
>   paired elements.  Each of the pairs associates a
>   property name (usually a symbol) with a property or value.
>                  ^^^^^^^

That is right, I always had that problem with plist, and still
do. Amount of the coping code on my side would become redundant if
that would be corrected to have a test function.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Sun, 28 Mar 2021 13:14:03 GMT) Full text and rfc822 format available.

Message #14 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 47425 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Sun, 28 Mar 2021 15:12:40 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Please consider adding a TEST comparer arg for plist keys.
>
> In Elisp, a plist key need not be a symbol:
>
> (plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)
>
> That "works" (and no error), but it doesn't do what's expected, since
> the keys should be compared with `equal' or `string=', not `eq'.

plist-put doesn't ensure that the operation makes sense here, no, but we
can't really add that at this point, either.

I think adding a comparison function makes sense, but on the other
hand -- we seem to be moving towards using map.el more for these things
now, so I'm not sure there's much enthusiasm for that.  On the other
hand, the generic map functions have the problem that they...  can't
really be used like plist-put.  Sure

(map-put! (list 'a 1) 'b 2)

works fine, but you can't create a plist that way, which makes these
functions barely usable at all for handling plists/alists:

(map-put! nil 'b 2)

will signal an error.

So does anybody have an opinion here?  I think I'm in favour of adding a
comparison function for all three `plist-*' functions.

Drew Adams <drew.adams <at> oracle.com> writes:

> That would also mean we wouldn't need `lax-plist-*' functions.

Yes, those are horrible functions, and are barely used anywhere.  (And
`lax-plist-member' is missing.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Sun, 28 Mar 2021 16:44:01 GMT) Full text and rfc822 format available.

Message #17 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Sun, 28 Mar 2021 16:43:19 +0000
> > Please consider adding a TEST comparer arg for plist keys.
> >
> > In Elisp, a plist key need not be a symbol:
> >
> > (plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)
> >
> > That "works" (and no error), but it doesn't do what's expected, since
> > the keys should be compared with `equal' or `string=', not `eq'.
> 
> plist-put doesn't ensure that the operation makes sense here, no, but we
> can't really add that at this point, either.

Please elaborate.  I don't know what you're saying,
or why.

> I think adding a comparison function makes sense, but on the other
> hand -- we seem to be moving towards using map.el more for these things
> now, so I'm not sure there's much enthusiasm for that.  On the other
> hand, the generic map functions have the problem that they...  can't
> really be used like plist-put.

No.  Please do _not_ bring generic mapping into this.
This is a legitimate issue about plists and plist
functions.

> So does anybody have an opinion here?  I think I'm in favour of adding a
> comparison function for all three `plist-*' functions.

+1. 

> > That would also mean we wouldn't need `lax-plist-*' functions.
> 
> Yes, those are horrible functions, and are barely used anywhere.  (And
> `lax-plist-member' is missing.)

Agreed.  But their existence is an argument that the
intention was to provide for the use of `equal' as
an alternative test pred to `eq'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Sun, 28 Mar 2021 19:22:02 GMT) Full text and rfc822 format available.

Message #20 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Philipp <p.stephani2 <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 47425 <at> debbugs.gnu.org,
 Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Sun, 28 Mar 2021 21:20:53 +0200
> So does anybody have an opinion here?  I think I'm in favour of adding a
> comparison function for all three `plist-*' functions.

I'm not a fan of this since it would mean that these functions will no longer be side-effect-free.
Adding a function argument to a function means that the function can no longer really promise anything, so it leads to code that's harder to reason about.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Sun, 28 Mar 2021 19:28:01 GMT) Full text and rfc822 format available.

Message #23 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philipp <p.stephani2 <at> gmail.com>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 47425 <at> debbugs.gnu.org,
 Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Sun, 28 Mar 2021 21:27:09 +0200
Philipp <p.stephani2 <at> gmail.com> writes:

> I'm not a fan of this since it would mean that these functions will no
> longer be side-effect-free.  Adding a function argument to a function
> means that the function can no longer really promise anything, so it
> leads to code that's harder to reason about.

`plist-put' already mutates state (of the plist), so it's not
side-effect-free...

The other ones are, though.  But...  I'm not sure that's really much of
a concern in practice.  (And Emacs should be able to reason about the
function, still, if the predicate passed in is side effect free, but I
guess we don't have the machinery for that in place?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 10:24:01 GMT) Full text and rfc822 format available.

Message #26 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Philipp <p.stephani2 <at> gmail.com>
Cc: Nicolas Petton <nicolas <at> petton.fr>, 47425 <at> debbugs.gnu.org,
 Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 12:22:59 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> I'm not a fan of this since it would mean that these functions will no
>> longer be side-effect-free.  Adding a function argument to a function
>> means that the function can no longer really promise anything, so it
>> leads to code that's harder to reason about.
>
> `plist-put' already mutates state (of the plist), so it's not
> side-effect-free...
>
> The other ones are, though.  But...  I'm not sure that's really much of
> a concern in practice.  (And Emacs should be able to reason about the
> function, still, if the predicate passed in is side effect free, but I
> guess we don't have the machinery for that in place?)

We don't.

Anyway, that was the only objection here, so I went ahead and made this
change in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 47425 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 27 Jun 2022 10:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 11:33:01 GMT) Full text and rfc822 format available.

Message #31 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: 47425 <at> debbugs.gnu.org
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 13:31:57 +0200
> I'm not a fan of this since it would mean that these functions will no longer be side-effect-free. Adding a function argument to a function means that the function can no longer really promise anything, so it leads to code that's harder to reason about. 

No fan of it either. A plist is not intended as a general-purpose data structure; the `eq` key comparison is pretty much built in.

The cost of adding an equality predicate is not huge but also not really motivated.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 11:44:01 GMT) Full text and rfc822 format available.

Message #34 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, 47425 <at> debbugs.gnu.org,
 Drew Adams <drew.adams <at> oracle.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 13:43:23 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> The cost of adding an equality predicate is not huge but also not
> really motivated.

The motivation is greater symmetry with assoc and friends.  That is,
people have been forced to use alists where they'd more naturally prefer
to use plists because of the eq restriction.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 12:19:01 GMT) Full text and rfc822 format available.

Message #37 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 47425 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 08:18:04 -0400
Lars Ingebrigtsen [2022-06-27 13:43:23] wrote:
> Mattias Engdegård <mattiase <at> acm.org> writes:
>> The cost of adding an equality predicate is not huge but also not
>> really motivated.
> The motivation is greater symmetry with assoc and friends.  That is,
> people have been forced to use alists where they'd more naturally prefer
> to use plists because of the eq restriction.

Then again, plists should never have existed, in my book.
They're just strictly worse than alists as datastructures.
Their only advantage is that sometimes when you write them by hand it
they're somewhat more compact (fewer dots and parentheses) but for those
cases `eq` is always good enough in my experience.

I'd be curious to hear of a use case where plists are better than alists
while at the same time requiring a non-eq comparison.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 12:29:01 GMT) Full text and rfc822 format available.

Message #40 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Nicolas Petton <nicolas <at> petton.fr>,
 47425 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 14:27:50 +0200
27 juni 2022 kl. 14.18 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

> Then again, plists should never have existed, in my book.
> They're just strictly worse than alists as datastructures.

Indeed. For example, key-value pairs cannot be shared between different plists, and getting the nth key takes twice as long.
There should be no reason to promote or expand the use of plists.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 12:43:02 GMT) Full text and rfc822 format available.

Message #43 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 47425 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 14:41:44 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I'd be curious to hear of a use case where plists are better than alists
> while at the same time requiring a non-eq comparison.

They're equivalent in features, yes, but people prefer plists for
simple structures because they look nicer.  I'd say they've proven their
popularity over half a century.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 12:45:01 GMT) Full text and rfc822 format available.

Message #46 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>, 47425 <at> debbugs.gnu.org
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 14:44:18 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> Indeed. For example, key-value pairs cannot be shared between
> different plists, and getting the nth key takes twice as long.
> There should be no reason to promote or expand the use of plists.

If you say "I want the nth", then, yes, it takes longer.  But nobody
does that with a plist or an alist -- they say "give me the value of
key", and that's an identical number of operations on a plist as on an
alist.

(Plist is car for eq, cdr + cdr for traversal, while alist is car + car
for eq, cdr for traversal.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 13:29:02 GMT) Full text and rfc822 format available.

Message #49 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>, 47425 <at> debbugs.gnu.org
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 15:28:17 +0200
27 juni 2022 kl. 14.44 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> If you say "I want the nth", then, yes, it takes longer.  But nobody
> does that with a plist or an alist

'Nobody' is too strong (done it a few times) but yes, it's not a common operation.

But the point is that alists has several more advantages: counting number of keys is twice as fast, iterating and/or transform the collection easily done with mapcar, mapcan, dolist, mapc etc. Plists have no real advantage from their structure.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 13:36:02 GMT) Full text and rfc822 format available.

Message #52 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>, 47425 <at> debbugs.gnu.org
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 15:35:27 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> But the point is that alists has several more advantages: counting
> number of keys is twice as fast,

Nobody does that either.  😀

> iterating and/or transform the collection easily done with mapcar,
> mapcan, dolist, mapc etc. Plists have no real advantage from their
> structure.

Yes, it's true that we have a lot more infrastructure that's geared
towards simple lists, and you can use those more easily with alists.
But mapcar etc aren't idea for alists, either.  We do have `on' in
`cl-loop'.  Adding some syntax to pcase for plists might be nice.
(I.e., for pcase-dolist etc.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 14:40:02 GMT) Full text and rfc822 format available.

Message #55 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Lars Ingebrigtsen
 <larsi <at> gnus.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 14:39:30 +0000
> Then again, plists should never have existed, in my book.
> They're just strictly worse than alists as datastructures.
> Their only advantage is that sometimes when you write them by hand it
> they're somewhat more compact (fewer dots and parentheses) but for
> those cases `eq` is always good enough in my experience.
>
> I'd be curious to hear of a use case where plists are better than
> alists while at the same time requiring a non-eq comparison.

Wow.  Stefan and I actually agree on something. ;-)

(Well, I wouldn't go as far as saying that they
never should have existed.  But as far as listie
things go, they're definitely nowhere near as
useful as alists.)

But whether plists should benefit from TEST
functions other than `eq' is unrelated to whether
alists might be generally - or even always "better"
than alists.

The fact is that some users use plists, even when
they could, and maybe even should, use alists.  And
this is likely to continue, if not increase, due to
experience with other languages and other key-value
representations (JSON etc.).

(Yes, IMO the manuals could tout the advantages of
alists more, or compare & contrast plists and alists
more.  But that's not a reason not to give plist
functions an optional TEST arg.)

Plists with, e.g., string keys aren't uncommon, and
that's likely to continue.  That's kinda the point,
here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 14:40:02 GMT) Full text and rfc822 format available.

Message #58 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>, Stefan Monnier
 <monnier <at> iro.umontreal.ca>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 14:39:35 +0000
> > Then again, plists should never have existed, in my book.
> > They're just strictly worse than alists as datastructures.
> 
> Indeed. For example, key-value pairs cannot be shared between 
> different plists, and getting the nth key takes twice as long.
> There should be no reason to promote or expand the use of plists.

I happen to agree.  Adding a TEST arg for plist
functions isn't, IMO, promoting or expanding
their use.  It's just recognizing existing use.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 14:40:03 GMT) Full text and rfc822 format available.

Message #61 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Stefan Monnier
 <monnier <at> iro.umontreal.ca>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 14:39:40 +0000
> > I'd be curious to hear of a use case where plists are better than
> > alists while at the same time requiring a non-eq comparison.
> 
> They're equivalent in features, yes, but people prefer plists for
> simple structures because they look nicer.  I'd say they've proven
> their popularity over half a century.

Yes, it's about recognizing that reality.

Unless you're going to somehow _prevent_ the
use of plists with keys that are other than,
e.g., symbols - in particular keys that are
strings, adding a TEST arg makes sense, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 14:40:04 GMT) Full text and rfc822 format available.

Message #64 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>, Lars Ingebrigtsen
 <larsi <at> gnus.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 14:39:44 +0000
> But the point is that alists has several more advantages: counting
> number of keys is twice as fast, iterating and/or transform the
> collection easily done with mapcar, mapcan, dolist, mapc etc. Plists
> have no real advantage from their structure.

Alists have a zillion advantages over plists.

That's not what this enhancement request is about.

A similar situation exists between vectors and
lists.  And even among different numeric types.
And even between Lisp symbols and strings.

It's the case that sometimes users use a type
that's less useful than another type in some
context.  That's irrelevant to whether plist
functions could benefit from a TEST arg.  IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 15:11:01 GMT) Full text and rfc822 format available.

Message #67 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Mattias Engdegård
 <mattiase <at> acm.org>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: Re: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put'
 should accept a TEST function
Date: Mon, 27 Jun 2022 11:09:57 -0400
> Plists with, e.g., string keys aren't uncommon, and

Really?  Can you give examples?


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 15:12:01 GMT) Full text and rfc822 format available.

Message #70 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 47425 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 11:11:49 -0400
> `cl-loop'.  Adding some syntax to pcase for plists might be nice.

Not!


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 15:19:01 GMT) Full text and rfc822 format available.

Message #73 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 Philipp Stephani <p.stephani2 <at> gmail.com>, Nicolas Petton <nicolas <at> petton.fr>,
 47425 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 17:18:12 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> `cl-loop'.  Adding some syntax to pcase for plists might be nice.
>
> Not!

🥳

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 17:08:01 GMT) Full text and rfc822 format available.

Message #76 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Mattias Engdegård <mattiase <at> acm.org>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Nicolas Petton <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 17:07:16 +0000
> > Plists with, e.g., string keys aren't uncommon
>
> Really?  Can you give examples?

Maybe I could, but I won't try.  I take it that
you don't think so.  That's fine.

My expectation is that more users nowadays may
be inclined to use string keys than in the past,
because (as I said) of the influence of things
like JSON.  This enhancement request is to cater
to what I expect will not be all that uncommon.

And there may be more and more use of conversion
of alists (which do often have nonsymbol keys)
to plists.  For whatever reasons (good & bad).

Note too, BTW, that (not uncommon) != common.
___

CLTL2, "The Property List" says, in passing,
that `symbol-plist' keys are "typically" symbols.
It doesn't say that they _are_ symbols.

And it doesn't say anywhere that they need to
be distinguishable with just `eq'.

In any case, I'll grant you that using symbol
keys _is_ common.  (The same is true of alist
keys, BTW.)
___

BTW, CLTL2 also points to this as the essential
difference between a plist and an alist:

  a property list is an object with a unique
  identity; the operations for adding and
  removing property-list entries are destructive
  operations that alter the property list rather
  than making a new one. Association lists, on
  the other hand, are normally augmented
  non-destructively (without side effects) by
  adding new entries to the front (see acons and
  pairlis).

No mention of plist keys being symbols.

However, it's also true that CL defines `remprop'
as using `eq'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 17:20:02 GMT) Full text and rfc822 format available.

Message #79 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Nicolas Petton <nicolas <at> petton.fr>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 19:19:53 +0200
> And it doesn't say anywhere that they need to
> be distinguishable with just `eq'.

Operations on property lists in Common Lisp use `eq`. There is no option to use another equality predicate.

This change is just needless gold-plating. Let's revert.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 17:24:02 GMT) Full text and rfc822 format available.

Message #82 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Nicolas Petton <nicolas <at> petton.fr>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Mon, 27 Jun 2022 19:22:45 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> This change is just needless gold-plating. Let's revert.

Nope.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Mon, 27 Jun 2022 17:42:02 GMT) Full text and rfc822 format available.

Message #85 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,
 Lars Ingebrigtsen <larsi <at> gnus.org>, Nicolas Petton <nicolas <at> petton.fr>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should
 accept a TEST function
Date: Mon, 27 Jun 2022 17:41:44 +0000
> > And it doesn't say anywhere that they need to
> > be distinguishable with just `eq'.
> 
> Operations on property lists in Common Lisp use `eq`.
> There is no option to use another equality predicate.

Yes, I mentioned that fact.

CL was of course defined 40 years ago.  And
its users, especially back then, didn't come
from backgrounds that commonly included using
key-value with string keys (such as JSON).

And CL didn't change pre-existing functions
(such as `remprop'), to give them :test args,
as much as it added such args to new functions.
CL sequence functions have :test, for example.
(And a plist is a sequence.).

Also, unlike Elisp, CL doesn't document any
use of plists other than `symbol-plist' - it
specifically didn't adopt the use of
"disembodied" plists, for example.
___

I don't think that providing a TEST arg will
needlessly encourage the use of non-symbol
keys.  I don't see how it will hurt, at all.

But if someone thinks it's very important to
discourage the use of non-symbol keys, then
that can be added to the doc string.  That's
not equivalent to not allowing a TEST arg.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Tue, 28 Jun 2022 15:24:04 GMT) Full text and rfc822 format available.

Message #88 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>,
 Mattias Engdegård <mattiase <at> acm.org>,
 Nicolas Petton <nicolas <at> petton.fr>, Philipp Stephani <p.stephani2 <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Tue, 28 Jun 2022 18:23:48 +0300
(let ((plist (list :a t)))
  (setf (plist-get plist :a) nil)
  plist)
;; => (:a nil)

(let ((plist (list :a t)))
  (setf (plist-get plist :a #'eq) nil)
  plist)
;; error-> wrong-number-of-arguments

Do we want the expander in gv.el to understand the new argument?

There's also the question of map.el.  Custom predicates are deprecated
there, since they rely on knowing the underlying map type.  Do we want
plist operations to understand custom predicates regardless?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Tue, 28 Jun 2022 15:41:02 GMT) Full text and rfc822 format available.

Message #91 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>,
 Mattias Engdegård <mattiase <at> acm.org>,
 Nicolas Petton <nicolas <at> petton.fr>, Philipp Stephani <p.stephani2 <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Tue, 28 Jun 2022 17:40:10 +0200
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> (let ((plist (list :a t)))
>   (setf (plist-get plist :a) nil)
>   plist)
> ;; => (:a nil)
>
> (let ((plist (list :a t)))
>   (setf (plist-get plist :a #'eq) nil)
>   plist)
> ;; error-> wrong-number-of-arguments
>
> Do we want the expander in gv.el to understand the new argument?

Yup.

> There's also the question of map.el.  Custom predicates are deprecated
> there, since they rely on knowing the underlying map type.  Do we want
> plist operations to understand custom predicates regardless?

Using the map functions for plists doesn't really work, so I don't think
it matters much.  That is, if you end up with a nil MAP after doing some
deletes, you suddenly can't put anything into the map.

I think expanding map.el to try to handle plists was a mistake -- it's a
fun hack, but can't be used meaningfully in practice.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Wed, 29 Jun 2022 03:34:01 GMT) Full text and rfc822 format available.

Message #94 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 47425 <at> debbugs.gnu.org, mattiase <at> acm.org, nicolas <at> petton.fr,
 p.stephani2 <at> gmail.com, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#47425: 26.3;
 `plist-get', `plist-put' and proposed TEST function
Date: Tue, 28 Jun 2022 23:33:40 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

CL-style keyword arguments to modify list operations are clunky.
Unless we implement them in an extra-complicated way, they will slow
down the usual case, too.  I understand the motivation for proposing
this change, but let's solve it in a cleaner way that doesn't invite
copying the bad designs of CL.

Here are two ways that occur to me.

* The applications that want to compare property names with `equal'
could canonicalize those names.  For instance, intern the strings
you want to use as property names, perhaps in a special obarray.
Then you can use `plist-get' and `plist-put' on them and get the
results you want.

* Define functions `plist-get-equal' and `plist-put-equal'.
Instead of complicating the definitions of widely used functions `plist-get'
and `plist-put', it will define two new functions that most users won't
need to pay attention to.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Wed, 29 Jun 2022 05:12:01 GMT) Full text and rfc822 format available.

Message #97 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "rms <at> gnu.org" <rms <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "mattiase <at> acm.org" <mattiase <at> acm.org>,
 "p.stephani2 <at> gmail.com" <p.stephani2 <at> gmail.com>,
 "nicolas <at> petton.fr" <nicolas <at> petton.fr>,
 "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>,
 "monnier <at> iro.umontreal.ca" <monnier <at> iro.umontreal.ca>
Subject: RE: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' and
 proposed TEST function
Date: Wed, 29 Jun 2022 05:11:05 +0000
> CL-style keyword arguments to modify list operations are clunky.
> Unless we implement them in an extra-complicated way, they will slow
> down the usual case, too.  I understand the motivation for proposing
> this change, but let's solve it in a cleaner way that doesn't invite
> copying the bad designs of CL.

I don't think this bug thread has anything to
do with keyword arguments or even with keywords
(e.g. :foobar) in any other way.  Keywords are
anyway symbols, so they compare fine with `eq'.

The suggestion was to add a TEST optional arg,
not a keyword :test arg.  IOW, follow what we
usually do in Emacs Lisp.

The motivation here is to support plists with
keys, such as strings, that can't be usefully
compared with `eq'.

> Here are two ways that occur to me.
> 
> * The applications that want to compare property names with `equal'
> could canonicalize those names.  For instance, intern the strings
> you want to use as property names, perhaps in a special obarray.
> Then you can use `plist-get' and `plist-put' on them and get the
> results you want.

Someone writing code from scratch can always
use symbols as keys (plist properties).  That's
not the problem.

The idea is to support existing plists that
have string keys.  (And some users will end up
with such plists, one way or another.)

> * Define functions `plist-get-equal' and `plist-put-equal'.
> Instead of complicating the definitions of widely used functions
> `plist-get' and `plist-put', it will define two new functions
> that most users won't need to pay attention to.

That solution is OK also.  That won't help
someone who comes across plist-get and -put
and mistakenly tries to use them with string
keys, but that's OK.  (After all, we have memq
and member...)


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47425; Package emacs. (Thu, 30 Jun 2022 03:11:01 GMT) Full text and rfc822 format available.

Message #100 received at 47425 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47425 <at> debbugs.gnu.org, mattiase <at> acm.org, nicolas <at> petton.fr,
 p.stephani2 <at> gmail.com, monnier <at> iro.umontreal.ca, larsi <at> gnus.org
Subject: Re: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' and
 proposed TEST function
Date: Wed, 29 Jun 2022 23:10:42 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The suggestion was to add a TEST optional arg,
  > not a keyword :test arg.  IOW, follow what we
  > usually do in Emacs Lisp.

Sorry.  I thought I had seen a proposal for a keyword arg.

However, I still think that the other methods I proposed are cleaner
overall.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Jul 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.