all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christian Ohler <ohler+emacs@fastmail.net>
To: MON KEY <monkey@sandpframing.com>
Cc: eliz@gnu.org, dan.colascione@gmail.com, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: moving more cl seq/mapping support into core
Date: Fri, 08 Oct 2010 11:37:07 +0930	[thread overview]
Message-ID: <4CAE7CCB.7030005@fastmail.net> (raw)
In-Reply-To: <AANLkTimyO45OFX8hFhuxutCTdm0BUJ3KFFMK1A7=T6ph@mail.gmail.com>

  On 6/10/10 9:59, MON KEY wrote:
> Does Ohler believe that his CL duplicates are better for their
> non-conformance and breaking with both the semantics of both the CL
> features and the Common Lisp features? Maybe he finds his duplicates
> achieve a desirable performance gain. Or, maybe he just doesn't feel it
> worth the trouble to rewrite _all_ of cl*.el.

Because a run-time dependency on cl.el would make it hard for ERT to 
become part of Emacs and triggers distracting warnings, I reimplemented 
the subset of CL that ERT requires.  I don't think this subset is better 
than cl.el, and I haven't checked which implementation is faster.

> If Ohler implemented his CL feature duplications as a kludge would he
> have simply done a (require 'cl) and been done with it were it not for
> the CL runtime ban?

Yes.

> And if so, would ERT be better/more correct by so doing?

Better?  Probably, since I could have spent my time on other features, 
and the definitions in cl.el may well be faster than my reimplementations.

More correct?  I'm not sure.  You are examining the behavior of 
`ert--remove-if-not' etc. for Common Lisp compliance; but there is no 
reason why it would have to be, since these functions are just private 
utilities in ERT.  They only provide the subset of CL functionality that 
ERT requires.  They either document that they only work on lists, or 
signal an error on sequence types that they don't support.

The check for dotted lists that you are looking for is guaranteed in 
Common Lisp only in what Common Lisp calls "safe code".  In safe code, 
Common Lisp also guarantees this check for `loop' and `member'; but 
`loop' and `member' in Emacs Lisp don't have this check.  So, ERT's 
CL-like utility functions behave like unsafe code in this regard, just 
like other Emacs Lisp functions.

If you have a concrete reason to believe that these functions lead to 
bugs in ERT, please let me know.

Reimplementing these CL utility functions (in 
http://github.com/ohler/ert/commit/cdc3dfad4779cb9421a6711f6ef7be522ca8e5b0 
) was actually only part of the work I had to do to avoid a run-time 
dependency on CL.  I also had to implement a special-purpose replacement 
for `typep' in 
http://github.com/ohler/ert/commit/bde37b42d0187356cfd747d5ec245b30690c2fcf 
, and the trickiest part was making ERT's call to `macroexpand' work 
regardless of whether cl.el is loaded, see 
http://github.com/ohler/ert/commit/f481a5c2b38a8ccd06b9ddd9c7243409fb583ea2 
: If cl.el is loaded, ERT needs to pass two arguments to `macroexpand', 
only one otherwise.  The solution is simple, but figuring out that this 
problem exists took me a while.

Christian.




  reply	other threads:[~2010-10-08  2:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 22:48 moving more cl seq/mapping support into core MON KEY
2010-09-25  5:13 ` Leo
2010-09-25  5:58   ` Miles Bader
2010-09-25 14:42     ` Drew Adams
2010-09-25 15:07       ` Leo
2010-09-25 15:23         ` Drew Adams
2010-09-25 15:30           ` Leo
2010-09-25 15:33             ` David Kastrup
2010-09-25 15:55               ` Drew Adams
2010-09-25 15:55             ` Drew Adams
2010-09-25 16:01               ` Leo
2010-10-01  0:33             ` Daniel Colascione
2010-09-25 21:26       ` Miles Bader
2010-09-26 10:37   ` Richard Stallman
2010-09-26 13:13     ` Leo
2010-09-26 19:32       ` Miles Bader
2010-09-27  6:27       ` Richard Stallman
2010-10-01  0:28         ` Daniel Colascione
2010-10-01  3:16           ` Miles Bader
2010-10-01 20:39             ` Daniel Colascione
2010-10-02  7:12               ` David Kastrup
2010-10-03 23:15                 ` Stefan Monnier
2010-10-04 17:41                   ` Daniel Colascione
2010-10-05 23:32                     ` Stefan Monnier
2010-10-01 11:42           ` Richard Stallman
2010-10-01 20:36             ` Daniel Colascione
2010-10-01 11:42           ` Richard Stallman
2010-10-01 20:34             ` Daniel Colascione
2010-10-01 21:12               ` Chong Yidong
2010-09-27 19:07 ` MON KEY
2010-10-02  5:35   ` MON KEY
2010-10-04  2:03     ` Richard Stallman
2010-10-04  5:51       ` MON KEY
2010-10-06  5:21         ` Richard Stallman
2010-10-09  0:29           ` MON KEY
2010-10-10  5:09             ` Richard Stallman
2010-10-04 17:33       ` Daniel Colascione
2010-10-05  9:55         ` Richard Stallman
2010-10-05 10:20           ` Helmut Eller
2010-10-05 18:27             ` Eli Zaretskii
2010-10-06 23:41             ` Richard Stallman
2010-10-07 15:04               ` Ted Zlatanov
2010-10-07 15:17               ` Karl Fogel
2010-10-09  2:13                 ` Richard Stallman
2010-10-05 13:07           ` Ted Zlatanov
2010-10-06 23:41             ` Richard Stallman
2010-10-07  9:20               ` Daniel Colascione
2010-10-08  5:47                 ` Richard Stallman
2010-10-05 18:26           ` Eli Zaretskii
2010-10-06  0:29           ` MON KEY
2010-10-08  2:07             ` Christian Ohler [this message]
2010-10-08  2:18               ` Miles Bader
2010-10-08  3:15                 ` Christian Ohler
2010-10-06  8:04           ` Stephen J. Turnbull
2010-10-06  9:20             ` David Kastrup

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=4CAE7CCB.7030005@fastmail.net \
    --to=ohler+emacs@fastmail.net \
    --cc=dan.colascione@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monkey@sandpframing.com \
    --cc=rms@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.