Is toDouble missing? #205
Unanswered
fischerscode
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm relying on AI to generate code that should then be evaluated, therefore I need
dart_evalto be quite close to actualdart. The other day, I got an error thattoDoubleis not working. Back then, I had no really an Idea howdart_evalworks, assumed that I'm doing something wrong, and just multiplied with1.0instead.Since I hate writing boilerplate and my project requires Wrappers that are not supported by
bindgen, I'm currently working on my own wrapper builder. (Disclaimer: When I started the project, I missed thatbindgenexists in the first place.)Now I have a better understanding of how wrappers operate and stumbled over the definition of
$numand$int. From what I can tell, they actually don't support most of the common dart features.BridgeClassDefsupported?$num.$getPropertydefined?toDoubleis actually not supported, is it safe toruntime.registerBridgeFunca custom$intwrapper? (Didn't even test if that works, but it seems like the later defined stuff is prioritized.)My current workaround would be the following:
int.dart_evaluses.By the way,
dart_evalseems to be such an unique and powerful project. 👏Edit:
I just found getKnownMethods. Maybe I can inject into the map, or at least this seams to be a starting point for a PR.
Beta Was this translation helpful? Give feedback.
All reactions