4 ms·
I have ~that. Of course it's not Common Lisp though (so, Hubris Lisp?). Notably you have to statically register the Go functions you want to be callable from th
by frou_dh 10y ago
I have ~that. Of course it's not Common Lisp though (so, Hubris Lisp?). Notably you have to statically register the Go functions you want to be callable from the Lisp side, because otherwise they might not even be present in the compiled binary (and even if they were, I don't think Go will help you find an arbitrary function by name at runtime). I've used it much more as a normal 'shebang' shell scripting language (even ""webapps"" via CGI) than an embedded one so far... mainly through lack of ideas that call for such a thing.
- coldtea 10y ago>and even if they were, I don't think Go will help you find an arbitrary function by name at runtime You'd be surprised: https://golang.org/pkg/reflect/#Value.MethodByName https://golang.org/pkg/reflect/#Value.MethodByName
- frou_dh 10y agoThat's about methods and not functions ;) Yes indeed, if you are partying in the context of a specific value, you can use that reflection. My language is not "OO"-aware though. Maybe after I give the embedded mode more real world use then that aspect will be unavoidable.
- coldtea 10y agoA, yes. In that case you could expose all the functions you want in advance, in some map that's accessible by (string) name.