[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: |
Mon, 06 Mar 2017 15:36:59 -0500 |
> Why add length= as a primitive? Why is it important enough to justify that?
About 14% of all calls to length are then simply compared via =. I checked and the < and > variants combined account for about 30%, the <= and >= combined about 10%. I don't really see a purpose in using nthcdr like you have in a lisp implementation of length=, it isn't any better than just using length directly since it requires just as much linked list traversal. That was of course the reason I implemented it in C.
> Wouldn't it make sense to have a function ‘length<’ and ‘length>’ as well?
Yes, it would appear so. But for the same reasons as length= they would need to be implemented in C for there to be any improvement in efficiency. They could be added to the < and > bytecodes in the same way that I've done with = and length=.
- 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 <=
- 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, 2017/03/12
- 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