Re: Macro like functionality for shorthand variable names

2008-06-07 Thread Paul Hankin
On Jun 7, 6:13 am, Tilman Kispersky <[EMAIL PROTECTED]> wrote: > I have python code in a class method translated from C++ that looks > sort of like this: > > >>>  self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) > > To make this more readable in C++ I had made macros to achieve this: > #de

Re: Macro like functionality for shorthand variable names

2008-06-07 Thread Larry Bates
Tilman Kispersky wrote: I have python code in a class method translated from C++ that looks sort of like this: self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) To make this more readable in C++ I had made macros to achieve this: #define du (dydt[1]) #define u (y[1]) #define V (y[0])

Re: Macro like functionality for shorthand variable names

2008-06-06 Thread Kay Schluehr
On 6 Jun., 23:13, Tilman Kispersky <[EMAIL PROTECTED]> wrote: > I have python code in a class method translated from C++ that looks > sort of like this: > > >>> self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) > > To make this more readable in C++ I had made macros to achieve this: > #def

Macro like functionality for shorthand variable names

2008-06-06 Thread Tilman Kispersky
I have python code in a class method translated from C++ that looks sort of like this: >>> self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) To make this more readable in C++ I had made macros to achieve this: #define du (dydt[1]) #define u (y[1]) #define V (y[0]) du = a * (b * V - u);