From a6dcdcad4fd8407cbd67fb1c2d293f0d3be88914 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 18 Nov 2017 18:29:11 -0500 Subject: Macro-binding glue, and a let macro --- README.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index 2b1bfcc..0301b24 100644 --- a/README.rst +++ b/README.rst @@ -174,7 +174,10 @@ layer to map Python return values to Actinide value lists. The ``bind_void`` helper ultimately calls that module's ``wrap_void`` to wrap the function, and ``bind_fn`` calls ``wrap_fn``. (Tuple-returning functions do not need to be wrapped.) If you prefer to manually bind functions using ``bind``, they must be -wrapped appropriately. +wrapped appropriately. An equivalent set of methods, ``macro_bind``, +``macro_bind_void``, ``macro_bind_fn``, and ``macro_bind_builtin`` bind values +to entries in the top-level macro table, instead of the top-level environment, +and allow extension of the language's syntax. Finally, Actinide can bind specially-crafted Python modules. If a module contains a top-level symbol named ``An`` (for the informal chemical symbol for @@ -201,6 +204,9 @@ The symbol must be bound to an instance of the ``Registry`` class from the def two_values(): return 1, "Two" + # @An.macro_bind, @An.macro_void, @An.macro_fn, and @An.macro_builtin follow + # the same pattern. + Going the other direction, values can be extracted from bindings in the session using the ``get`` method: -- cgit v1.2.3