[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] More thoughs on Re: code suggestion
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-hackers] More thoughs on Re: code suggestion |
Date: |
Mon, 1 Feb 2016 22:03:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0 |
Same trick may be applicable to C_make_structure .
/Jörg
Am 01.02.2016 um 19:53 schrieb Jörg F. Wittenberger:
> Sure I had to forget the attachment.
>
> In the meantime I tried the last thought and it worked. Even less code now:
>
> void C_ccall C_make_vector(C_word c, C_word *av)
> {
> C_word av2[2], *v=av+1;
> av2[0] = av[1];
> *v = C_VECTOR_TYPE | (c-2);
> av2[1] = (C_word) v;
> C_do_apply(2, av2);
> }
>
> (define vector (##core#primitive "C_make_vector"))
>
> This time with test attached.