viktor-ferenczi / genshi-compiler

Genshi markup template compiler
0 stars 0 forks source link

Add support for variable type declarations #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We might consider adding support for type declarations. It could be done by 
introducing a separate attribute to `py:def` and `py:with`, plus the `compile` 
method. It could also be done by introducing some special syntax in the 
existing attributes and `arguments` parameter, like `variable_name:type`.

Declaring the type would allow for the generation of Cython code, which could 
be compiled to even faster code. It would also allow for C++ code generation, 
for example by using the standard C++ library to implement the lists and 
dictionaries. Such C++ code generation would go into a separate task, certainly.

Original issue reported on code.google.com by ferenczi.viktor on 15 Jul 2011 at 1:48

GoogleCodeExporter commented 9 years ago
My decision is that the user is responsible for putting the right expression 
into the `py:with`, `py:for`, etc. directives appropriate for the target 
language including the type declarations. So we should not have specific 
support for type declarations other than required by the target language.

Original comment by ferenczi.viktor on 16 Jan 2012 at 3:01

GoogleCodeExporter commented 9 years ago

Original comment by ferenczi.viktor on 16 Jan 2012 at 3:02