You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Things that came up in a discussion with @azazel75 that could be added to the docs:
A block macro gets as its argument, and is expected to return, a list of AST nodes. This is related to Block macro outputting a single-item body #7; it was surprising to a new user, because the argument is named tree, which suggests a single root node.
will capture the statements in the body of the with: in this case a list containing the AST for do_stuff() and return blah.
The fact that the input is (always) a list is only mentioned as part of a particular example. An easy fix is:
will capture the statements in the body of the with, as a list: in this case a list containing the AST for do_stuff() and return blah.
Should probably also be emphasized somewhere that the return value of a block macro is expected to be a list. A list, even, to guard against users such as myself that interpret the first variant as "a listy thing", and then choose a tuple because it's immutable.
(Accidentally hit the post button. Will continue in the next comment.)
Things that came up in a discussion with @azazel75 that could be added to the docs:
listof AST nodes. This is related to Block macro outputting a single-item body #7; it was surprising to a new user, because the argument is namedtree, which suggests a single root node.Currently the documentation says:
will capture the statements in the body of the with: in this case a list containing the AST for do_stuff() and return blah.
The fact that the input is (always) a list is only mentioned as part of a particular example. An easy fix is:
will capture the statements in the body of the with, as a list: in this case a list containing the AST for do_stuff() and return blah.
Should probably also be emphasized somewhere that the return value of a block macro is expected to be a list. A
list, even, to guard against users such as myself that interpret the first variant as "a listy thing", and then choose a tuple because it's immutable.(Accidentally hit the post button. Will continue in the next comment.)