[AST] question about marshal_write_*() fxns

For those of you who don't know, I am sprinting on the AST branch here on PyCon. Specifically, I am fleshing out Python/compile.txt so that it can act as a good intro to new users and as a design doc. But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format, but there is mention of a byte stream format and so I thought it might be that as well. Anyone know which one it is? -Brett

On Mon, Mar 21, 2005 at 11:53:04AM -0500, Brett C. wrote:
But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format, but there is mention of a byte stream format and so I thought it might be that as well.
I believe the idea is that they can be used to move an AST back and forth between Python "space" (e.g. you could build an AST using Python code and then marshal it and send it to the C compiler). Neil

Neil Schemenauer wrote:
On Mon, Mar 21, 2005 at 11:53:04AM -0500, Brett C. wrote:
But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format, but there is mention of a byte stream format and so I thought it might be that as well.
I believe the idea is that they can be used to move an AST back and forth between Python "space" (e.g. you could build an AST using Python code and then marshal it and send it to the C compiler).
Jeremy emailed me and said the same thing. Name should be changed, though, to prevent this confusion. Jeremy thought maybe the name should be changed. Here are some ideas for a different name (thinking in terms of what the name would be changed to for the prefix of the function names): - byte_encode - linear_form - zephyr_encoding - flat_form - flat_prefix - prefix_form - scheme_form =) For those that don't know and it wasn't obvious from the names, the format is a prefix-based, linear form. -Brett

Brett C. wrote:
For those of you who don't know, I am sprinting on the AST branch here on PyCon.
Ah, so that's why it's quiet this week :)
But one of things I am not sure of is what the marshal_write_*() functions in Python/Python-ast.c are used for. I assume they output to the marshal format, but there is mention of a byte stream format and so I thought it might be that as well.
Given Neil & Jeremy's answers, perhaps "linear_ast_*" or "bytestream_ast_*" would work as a new prefix? Cheers, Nick. -- Nick Coghlan | ncoghlan@email.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.skystorm.net
participants (3)
-
Brett C.
-
Neil Schemenauer
-
Nick Coghlan