Hallo,
I almost started coding something like ##subu8vector-move! when I found it in the source code. Is there any caveat with using it? It is not in the manual.
Cheers,
Afficher les réponses par date
On 2-Sep-09, at 11:43 AM, Alex Queiroz wrote:
Hallo,
I almost started coding something like ##subu8vector-move! when Ifound it in the source code. Is there any caveat with using it? It is not in the manual.
It does no type checking, so use at your own risk.
I could expose it and other procedures on the various vector types by adding some type checking. Here are some procedures that could be exposed:
(define v (vector 1 2 3 4 5)) (##append-vectors (list v v v))
#(1 2 3 4 5 1 2 3 4 5 1 2 3 4 5)
(##subvector-fill! v 1 3 99) v
#(1 99 99 4 5)
(##subvector-move! '#(a b c d e) 2 4 v 1) v
#(1 c d 4 5)
They are available for u8vectors, f64vectors, etc. (by replacing "vector" by "u8vector", etc).
Here's the deal... I will expose them as soon as someone contributes the corresponding documentation (for gambit-c.txi)!
Marc
Hallo,
On 9/2/09, Marc Feeley feeley@iro.umontreal.ca wrote:
Here's the deal... I will expose them as soon as someone contributes the corresponding documentation (for gambit-c.txi)!
It's a bargain! Please tell me if this patch is enough.
Cheers,
On 2-Sep-09, at 2:30 PM, Alex Queiroz wrote:
It's a bargain! Please tell me if this patch is enough.
Thanks! It would be nice to have some examples, and also your specification for append-vectors is not quite correct (it is not the vector analog of "append", cause that is "vector-append", so (append- vectors X) = (apply vector-append X)).
Marc
Hallo,
On 9/2/09, Marc Feeley feeley@iro.umontreal.ca wrote:
Thanks! It would be nice to have some examples, and also your specification for append-vectors is not quite correct (it is not the vector analog of "append", cause that is "vector-append", so (append-vectors X) = (apply vector-append X)).
Ok, I am sending another diff. Again, please tell me if it works for Gambit.
Thank you for the diffs for gambit-c.txi . I have added the procedures append-vectors, subvector-fill!, subvector-move!, vector- shrink! and their string/u8vector/... analog. I've just pushed the changes to the Gambit repo.
Marc
On 4-Sep-09, at 1:45 PM, Alex Queiroz wrote:
Hallo,
On 9/2/09, Marc Feeley feeley@iro.umontreal.ca wrote:
Thanks! It would be nice to have some examples, and also your specification for append-vectors is not quite correct (it is not the vector analog of "append", cause that is "vector-append", so (append- vectors X) = (apply vector-append X)).
Ok, I am sending another diff. Again, please tell me if it works for Gambit.
-- -alex http://www.ventonegro.org/ <gambit-c.txi.diff>