Closed skx closed 7 months ago
On reflection - pun intended - I'm not sold on this approach:
I think there's a middle-ground here:
TLDR:
(import 'strings "ToUpper" "ToLower")
However - major problem - you can't iterate over methods of a package. So I still have to hardcode options (such as "strings", "time", "os"). Meh. Maybe I should just abandon the whole idea?
This is a proof of concept for calling golang functions from yal, via the use of reflection. There's a bit of overhead in massaging the types into suitable forms - both for arguments, and results, but the core idea seems reasonable.
With this built and installed you can run:
Needs more work in deciding what to add, and better conversion routines. (c.f. evalfilter).
TODO:
(specials)
from builtin-package to specials, and add keys from theReflected
map.But this updates #139.