[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add new lisp function length= with bytecode support
From: |
Gdobbins |
Subject: |
Re: [PATCH] Add new lisp function length= with bytecode support |
Date: |
Sun, 12 Mar 2017 22:51:31 -0400 |
Attached is a new patch which modifies the byte-interpreter to use C functions for comparing list length to numbers at run-time. It does this by checking if the next bytecode is a comparison op when it encounters a length op. It does not have the problem of incompatibly changing = like the last method. The only remaining incompatible change is forms like (= 0 (length some-long-circular-list)) will now not throw an error, instead they will return nil in byte-compiled code. Similarly for dotted lists. The rare code which does require the error to be thrown can switch to (= 0 (safe-length some-long-circular-list)) to regain the behavior.
This change also makes length= and related then either worse than not having them, or they become trivial:
(defun length= (number list)
(= number (length list)))
Regardless of if this change is acceptable, I also need to get my copyright assignment done. I'm working on another unrelated patch as well.
0001-Optimize-bytecode-interpeter-for-numeric-comparisons.patch
Description: Text Data
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/05
- Re: [PATCH] Add new lisp function length= with bytecode support, Elias Mårtenson, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, John Wiegley, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Richard Stallman, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Clément Pit-Claudel, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/06
- Re: [PATCH] Add new lisp function length= with bytecode support, Ken Raeburn, 2017/03/10
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/10
- Re: [PATCH] Add new lisp function length= with bytecode support,
Gdobbins <=
- Re: [PATCH] Add new lisp function length= with bytecode support, Stefan Monnier, 2017/03/12
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/14
- [PATCH] Add new lisp function length= with bytecode support, Constantin Kulikov, 2017/03/07
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/07
- Re: [PATCH] Add new lisp function length= with bytecode support, Stefan Monnier, 2017/03/07
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/07
- Re: [PATCH] Add new lisp function length= with bytecode support, Stefan Monnier, 2017/03/07
- Re: [PATCH] Add new lisp function length= with bytecode support, Gdobbins, 2017/03/08
- Re: [PATCH] Add new lisp function length= with bytecode support, Stefan Monnier, 2017/03/08