Replies: 5 comments 5 replies
-
AFAIK there isn't a way to do it yet. But we'd be very happy if someone wrote a pull request for that :) I believe it shouldn't be too difficult to implement, and I could show you the ropes if you're interested. Currently the IR already implements the special cases "isNil" and "IsTruthy" and this would be a natural generalization of that. |
Beta Was this translation helpful? Give feedback.
-
We're already storing the type names in the metatable field (IIRC) so it would be a great idea to add this functionality. |
Beta Was this translation helpful? Give feedback.
-
I need to get through tax season before I can take on any new projects, so it will be a couple more months. But I was also poking at the const ticket. I would expect to benefit from optimizing global const variables since I like to use that pattern a lot. But compilers are not my area of expertise, so I was unable to glean any ideas on how to implement this by looking at the code. I am curious if the const support or this problem is easier. And would getting a walkthrough of how one of those works directly be applicable to the other? But perhaps my biggest question is, what is the roadmap of the C FFI? For me, that is potentially the most valuable thing. |
Beta Was this translation helpful? Give feedback.
-
I looked all over my files and haven't found it. I'm asking some friends to send me a copy and will post it online when I get it. |
Beta Was this translation helpful? Give feedback.
-
Source code is in the ffi branch of Gabriel's fork of the repository: https://github.com/GCdePaula/pallene/tree/ffi |
Beta Was this translation helpful? Give feedback.
-
Is it possible to determine the type of a record at runtime?
I wrote myself into a little hole where this would be useful. I have several similar record types which I thought I could keep completely separate in their usages. But I have a case now where they relate to another, it would be really convenient to place 'any' of these records into a list of {any}. But when I retrieve them from the list, I need to be able to figure out which kind of record it is.
Incidentally, I have been thinking to keep separate lists internally, but this will force me to create multiple API calls to cover all the combinatorials the different types can be put together. I'm thinking function overloading to handle different types might be a really nice feature here for callers of that API set. I've also been thinking function overloading would have been convenient for handling some Lua APIs that can take different number of arguments and types.
Beta Was this translation helpful? Give feedback.
All reactions