On Nov 27, 9:56 pm, "Hendrik van Rooyen" wrote:
> "Steven D'Aprano"
>
> >GUI designer. You write a program to let the user create code by clicking
> >buttons, dragging objects, drawing lines, etc. The GUI designer may use
> >classes, but the purpose of those classes is to generate source code.
>
On Nov 27, 8:21 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
snip
> body = 'L.append(None)\n'
> make_file('dumb.py', 'Create a big list the dumb way.',
> 'L = []\n', body*numitems)
> make_file('smart.py', 'Create a big list the smart way.',
> '', 'L = [None]*%d\n' % num
On Nov 27, 9:28 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> "Aaron Brady" <[EMAIL PROTECTED]> wrote:
...
> >As you can see, the 'visit' method is mechanical for classes A and B.
> >One might want to autogenerate those in some languages, but Python has
> >introspection:
>
> >class BaseAB:
On Nov 27, 8:55 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> Then another thing - it strikes me that any problem that can be solved
> by metaprogramming, can be solved by putting similar code into a class
> and instanciating an instance.
>
> Does anybody know if this is true?
>
> If it is,
On Fri, 28 Nov 2008 05:05:10 +0200, Hendrik van Rooyen wrote:
> "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
>
>> Hendrik van Rooyen wrote:
>>
>> > I am using the term in the restricted sense of Python writing Python
>> > source.
>> >
>> > Given that, can anybody think of an example that you could
On 27 Nov., 06:11, Rafe <[EMAIL PROTECTED]> wrote:
> On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > "Steven D'Aprano" wrote:
>
> > > Well, I don't know about "any problem". And it's not so much about
> > > whether metaprograms can solve problems that can't be sol
Hendrik van Rooyen wrote:
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
Hendrik van Rooyen wrote:
I am using the term in the restricted sense of Python writing Python source.
Given that, can anybody think of an example that you could not do with
a class? (excepting the "stored procedure" aspec
"Michele Simionato" <[EMAIL PROTECTED]> wrote:
>The namedtuple recipe by Raymond Hettinger (http://
>code.activestate.com/recipes/500261)
>is an interesting example of code generation. My own decorator module
>use a similar
>trick. Here code generation (plus eval/exec) is needed since you need
>c
"Kay Schluehr" <[EMAIL PROTECTED]> wrote:
>
> I just noticed that corepy 1.0 [1] has been released. Corepy is an
> embedded DSL for synthesizing machine code from chaining Python
> commands. This means it provides objects and exploits control
> structures used to create machine code that can f
"Steven D'Aprano" <[EMAIL PROTECTED]>
>GUI designer. You write a program to let the user create code by clicking
>buttons, dragging objects, drawing lines, etc. The GUI designer may use
>classes, but the purpose of those classes is to generate source code.
>
Yikes, this is getting hairy- If "
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
> Hendrik van Rooyen wrote:
>
> > I am using the term in the restricted sense of Python writing Python source.
> >
> > Given that, can anybody think of an example that you could not do with
> > a class? (excepting the "stored procedure" aspect)
>
> I am
"Aaron Brady" <[EMAIL PROTECTED]> wrote:
>On Nov 26, 10:41 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
>wrote:
>> "Steven D'Aprano" wrote:
>>
>>
>>
>> > Well, I don't know about "any problem". And it's not so much about
>> > whether metaprograms can solve problems that can't be solved by anythi
On Nov 27, 5:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> Given that, can anybody think of an example that you could not do with
> a class? (excepting the "stored procedure" aspect)
The namedtuple recipe by Raymond Hettinger (http://
code.activestate.com/recipes/500261)
is an interest
Rafe wrote:
> In the name of self-education can anyone share some pointers, links,
> modules, etc that I might use to begin learning how to do some
> "metaprogramming".
Fred Brooks, in his classic "Mythical Man-Month", defined "metaprogramming" as
simply a very high-level form of programming, us
On Nov 27, 12:11 pm, Rafe <[EMAIL PROTECTED]> wrote:
> On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > "Steven D'Aprano" wrote:
>
> > > Well, I don't know about "any problem". And it's not so much about
> > > whether metaprograms can solve problems that can't be s
On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
wrote:
> "Steven D'Aprano" wrote:
>
>
>
> > Well, I don't know about "any problem". And it's not so much about
> > whether metaprograms can solve problems that can't be solved by anything
> > else, as whether metaprograms can solve pro
On Nov 26, 6:29 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Thu, 27 Nov 2008 06:41:47 +0200, Hendrik van Rooyen wrote:
> > I am using the term in the restricted sense of Python writing Python
> > source.
>
> > Given that, can anybody think of an example that you could not do with a
> > clas
On Thu, 27 Nov 2008 06:41:47 +0200, Hendrik van Rooyen wrote:
> I am using the term in the restricted sense of Python writing Python
> source.
>
> Given that, can anybody think of an example that you could not do with a
> class? (excepting the "stored procedure" aspect)
GUI designer. You write
On Nov 26, 10:41 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
wrote:
> "Steven D'Aprano" wrote:
>
>
>
> > Well, I don't know about "any problem". And it's not so much about
> > whether metaprograms can solve problems that can't be solved by anything
> > else, as whether metaprograms can solve pro
Hendrik van Rooyen wrote:
I am using the term in the restricted sense of Python writing Python source.
Given that, can anybody think of an example that you could not do with
a class? (excepting the "stored procedure" aspect)
I am not sure I understand your question.
def iterize(recursive_f
On 27 Nov., 05:41, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> Given that, can anybody think of an example that you could not do with
> a class? (excepting the "stored procedure" aspect)
I just noticed that corepy 1.0 [1] has been released. Corepy is an
embedded DSL for synthesizing machin
"Steven D'Aprano" wrote:
>
> Well, I don't know about "any problem". And it's not so much about
> whether metaprograms can solve problems that can't be solved by anything
> else, as whether metaprograms can solve problems more effectively than
> other techniques.
>
> If you include factory
On 25 Nov., 11:08, Rafe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In the name of self-education can anyone share some pointers, links,
> modules, etc that I might use to begin learning how to do some
> "metaprogramming". That is, using code to write code (right?)
>
> Cheers,
>
> - Rafe
http://www.letme
On Thu, 27 Nov 2008 00:55:33 +0200, Hendrik van Rooyen wrote:
> "Aaron Brady" <[EMAIL PROTECTED]> wrote:
>
>
>>I don't know a clean, reliable way to structure a metaprogram though.
>>Mine always turn out messy.
>
> Yes.
>
> Then another thing - it strikes me that any problem that can be solved
On Nov 26, 11:55 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
wrote:
> Then another thing - it strikes me that any problem that can be solved
> by metaprogramming, can be solved by putting similar code into a class
> and instanciating an instance.
>
> Does anybody know if this is true?
>
> If it is
"Aaron Brady" <[EMAIL PROTECTED]> wrote:
>I don't know a clean, reliable way to structure a metaprogram though.
>Mine always turn out messy.
Yes.
Then another thing - it strikes me that any problem that can be solved
by metaprogramming, can be solved by putting similar code into a class
and ins
Aaron Brady <[EMAIL PROTECTED]> writes:
> I don't know a clean, reliable way to structure a metaprogram though.
> Mine always turn out messy.
I don't think Python is designed for large scale metaprogramming. Lisp
is the only naturally suited language that I know.
--
Arnaud
--
http://mail.pytho
On Nov 25, 5:20 am, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> On Nov 25, 12:12 pm, Rafe <[EMAIL PROTECTED]> wrote:
>
> > is it really as simple as gathering strings of code?
>
> Yes.
Yes.
> > Sort of like generating HTML or XML directly? Is there any other framework
> > or
> > pattern set t
Rafe wrote:
On Nov 25, 5:41 pm, Aaron Brady <[EMAIL PROTECTED]> wrote:
On Nov 25, 4:08 am, Rafe <[EMAIL PROTECTED]> wrote:
Hi,
In the name of self-education can anyone share some pointers, links,
modules, etc that I might use to begin learning how to do some
"metaprogramming".
On Nov 25, 12:12 pm, Rafe <[EMAIL PROTECTED]> wrote:
> is it really as simple as gathering strings of code?
Yes.
> Sort of like generating HTML or XML directly? Is there any other framework or
> pattern set that is worth looking in to?
Yes, the compiler module and the ast module in the standard
On Nov 25, 5:41 pm, Aaron Brady <[EMAIL PROTECTED]> wrote:
> On Nov 25, 4:08 am, Rafe <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > In the name of self-education can anyone share some pointers, links,
> > modules, etc that I might use to begin learning how to do some
> > "metaprogramming". That is, us
On Nov 25, 4:08 am, Rafe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In the name of self-education can anyone share some pointers, links,
> modules, etc that I might use to begin learning how to do some
> "metaprogramming". That is, using code to write code (right?)
>
> Cheers,
>
> - Rafe
Python programs
On Nov 25, 11:08 am, Rafe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> In the name of self-education can anyone share some pointers, links,
> modules, etc that I might use to begin learning how to do some
> "metaprogramming". That is, using code to write code (right?)
>
> Cheers,
>
> - Rafe
The word "meta
Hi,
In the name of self-education can anyone share some pointers, links,
modules, etc that I might use to begin learning how to do some
"metaprogramming". That is, using code to write code (right?)
Cheers,
- Rafe
--
http://mail.python.org/mailman/listinfo/python-list
34 matches
Mail list logo