-
Hello, had a question about library usage. Not a feature request or a bug, but this repo doesn't have discussions enabled. Was looking to import types from my own code into an interpreter. Based on the example in the README that uses So I tried stdlib.Symbols["github.com/nwunderly/disgo"] = map[string]reflect.Value{
"Context": reflect.ValueOf((*disgo.Context)(nil)),
} where My issue was in the custom import. I got varied panics and unhelpful errors with small tweaks to this, but it seems that the above code alone isn't enough to allow me to import a custom module. I was just looking for advice, since I seem to be missing something. Is there something else necessary to be able to add modules to the imports for an interpreter? I'd appreciate any suggestions or guidance. (I doubt it's necessary (and frankly my code right now is a mess), but my attempts at this can be found here.) Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should look at the |
Beta Was this translation helpful? Give feedback.
You should look at the
yaegi extract
command to automatically generate wrappers around the packages that you want to expose to yaegi. The starting point isyaegi help extract
.