I didn't have anything specific in mind, just curious about what is
possible and how much work is required. Sounds like it's something
I'll probably avoid for now. Thanks for the API and info about adding
special commands!
I can't offer much feedback about Mozilla Public License because it's
not
So, the fastest way on the compile-side for making collections of functions
(optionally, tied to some common data type) is using closures? I thought so
also, that's the direction I went instead of interfaces in my own work for
the same reason.
On Sunday, 29 April 2018 16:52:44 UTC+3, Max
About the "other languages extensions":
it's obviously easier than modifying the official Go compiler, but it's
usually still a major task,
especially if it involves modifying the "poor man's compiler" fast.Comp
which converts a parsed ast.Node into a tree of function closures for
execution.
Done and documented :)
As I also wrote in README.md, see
https://github.com/cosmos72/gomacro/blob/master/fast/cmd.go#L37
for the documentation and API to define new special commands.
The TL;DR summary is:
choose a name for the new command, write a function with signature
func(interp
Adding custom :foo commands is trivial, it's just a matter of exporting an api
to do register them (the api exists already, but it's not exported and I would
use the occasion to improve it). I should have time to do it tomorrow and
document an example.
About the license: yes, I am still
Do you have examples of adding custom ":xyz" or other language extensions?
Also, are you still deciding what to do with the license (I see there
is an open issue about it)? I was thinking of using gomacro for an
internal project at work, but use of LGPL libraries is not allowed,
unfortunately.
website: https://github.com/cosmos72/gomacro
install: go get github.com/cosmos72/gomacro
At version 2.6, gomacro has almost complete Go language support, including
import of third-party libraries (easy on Linux, requires a recompiling on
other platforms),
declaring new interface types and