Add a way to create types in LBM code #20
svenssonjoel
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Do you have some example of something that becomes easier with this approach that can't be done easily today? As far as I know I haven't come across any situation where I miss something like this. Also, would it be possible to make this in lisp alone without involving C? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is no way (other than custom types) to add a new type to LBM.
Taking inspiration from ELISP defstruct and making use of LBM lisp-arrays we can come up with a way to create struct like types from LBM code.
(defstruct mystruct '(a b c)) could create the "shape of a struct" with three fields names a, b, c. When the defstruct is executed code will be generated:
This is a high-level early sketch of what is possible all input and insights are very welcome.
Potential downsides:
Beta Was this translation helpful? Give feedback.
All reactions