4 ms·
I like that the comments mention another two implementations of a similar idea and all are a bit different. Here's one I've written a few years ago: https://gi
by kiryk 4y ago
I like that the comments mention another two implementations of a similar idea and all are a bit different.
Here's one I've written a few years ago: https://github.com/kiryk/mlisp/blob/master/vector.c https://github.com/kiryk/mlisp/blob/master/vector.c
You may find it dirty, but it can be wrapped using macros, and used both on LHS and RHS like in "string(v, i) = ch"
(the macros BTW) https://github.com/kiryk/mlisp/blob/71d028738d2f9607fa7ce8c1a59e33255460e03e/lisp.h#L3-L5 https://github.com/kiryk/mlisp/blob/71d028738d2f9607fa7ce8c1...
(and a usecase) https://github.com/kiryk/mlisp/blob/71d028738d2f9607fa7ce8c1a59e33255460e03e/main.c#L29 https://github.com/kiryk/mlisp/blob/71d028738d2f9607fa7ce8c1...