From 170c0b053335f1d0f5d1acd5f8dfa373c7c781cf Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 12 Sep 2014 12:51:28 +0200 Subject: [PATCH] python-bond 1.3 release notes and docs --- NEWS.rst | 8 ++++++++ README.rst | 22 +++++++++++++++++++++- setup.py | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) 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",