diff --git a/NEWS.rst b/NEWS.rst index b9a857e..d097592 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1,3 +1,11 @@ +python-bond 1.3 +--------------- + +* Added support for "Quoted expressions". ``call()`` can now be used on remote + functions expecting one or more remote unserializable objects as their + arguments, without the need of a support function and/or ``eval()``. + + python-bond 1.2 --------------- diff --git a/README.rst b/README.rst index cfa3791..496f88a 100644 --- a/README.rst +++ b/README.rst @@ -321,10 +321,30 @@ such as file descriptors, without the use of a support function and/or eval: .. code:: python3 pl = make_bond('Perl') - pl.eval_block('open($fd, "file.txt");') fd = pl.ref('$fd') + pl.call('syswrite', fd, "Hello world!") pl.call('close', fd) +Since ``ref()`` objects cannot be nested, there are still cases where it might +be necessary to use a support function. To demonstrate, we rewrite the above +example without quoted expressions, while still allowing an argument ("Hello +world!") to be local: + +.. code:: python3 + + pl = make_bond('Perl') + pl.eval_block('open($fd, ">file.txt");') + pl.eval_block('sub syswrite_fd { syswrite($fd, shift()); };') + pl.call('syswrite_fd', "Hello world!") + pl.eval('close($fd)') + +Or more succinctly: + +.. code:: python3 + + pl.call('sub { syswrite($fd, shift()); }', "Hello world!") + Language support ================ diff --git a/setup.py b/setup.py index c2b0e1b..a8ddd1e 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ + '\n'.join(news.split('\n\n\n', 1)[0].splitlines()[2:])) # the actual setup -setup(name='python-bond', version='1.2', +setup(name='python-bond', version='1.3', description='transparent remote/recursive evaluation between Python and other languages', author="Yuri D'Elia",