Re: Limits of Metaprogramming

2008-08-08 Thread Iain King
On Aug 4, 5:13 pm, Tomasz Rola [EMAIL PROTECTED] wrote: On Mon, 4 Aug 2008, Wilson wrote: Every sufficiently large application has a poor/incomplete implementation ofLISPembedded within it . Yep, this is either exact or very close copy of what I have read. It's Greenspun's Tenth Rule of

Re: Limits of Metaprogramming

2008-08-08 Thread Wilson
On 8 Aug, 13:30, Iain King [EMAIL PROTECTED] wrote: On Aug 4, 5:13 pm, Tomasz Rola [EMAIL PROTECTED] wrote: On Mon, 4 Aug 2008, Wilson wrote: Every sufficiently large application has a poor/incomplete implementation ofLISPembedded within it . Yep, this is either exact or very close

Re: Limits of Metaprogramming

2008-08-07 Thread castironpi
On Aug 7, 2:01 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 6, 6:04 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 6, 7:24 am, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 9:23 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 4, 1:57 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 6:49 

Re: Limits of Metaprogramming

2008-08-06 Thread Wilson
On Aug 4, 9:23 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 4, 1:57 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: Two, if all your methods will have uniform signatures and closures, you can store class methods as only their co_code objects:

Re: Limits of Metaprogramming

2008-08-06 Thread castironpi
On Aug 6, 7:24 am, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 9:23 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 4, 1:57 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: Two, if all your methods will have uniform signatures and closures,

Limits of Metaprogramming

2008-08-04 Thread Wilson
Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why I'm asking on this group): I'd like to write a program that

Re: Limits of Metaprogramming

2008-08-04 Thread Jeff
You could write a class composed of states and then use the pickle module to serialize it to disk. -- http://mail.python.org/mailman/listinfo/python-list

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 12:55, Jeff [EMAIL PROTECTED] wrote: You could write a class composed of states and then use the pickle module to serialize it to disk. Thanks Jeff. I guess this is my intermediary format! -- http://mail.python.org/mailman/listinfo/python-list

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
On Mon, 4 Aug 2008, Wilson wrote: Hi all, Howdy, I am not sure if my remarks will be of any use for you, but here it goes. I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 14:47, Tomasz Rola [EMAIL PROTECTED] wrote: On Mon, 4 Aug 2008, Wilson wrote: Hi all, Howdy, I am not sure if my remarks will be of any use for you, but here it goes. I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far

Re: Limits of Metaprogramming

2008-08-04 Thread John Nagle
Wilson wrote: Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why I'm asking on this group): I'd like to write a program that

Re: Limits of Metaprogramming

2008-08-04 Thread Tomasz Rola
On Mon, 4 Aug 2008, Wilson wrote: Every sufficiently large application has a poor/incomplete implementation of LISP embedded within it . Yep, this is either exact or very close copy of what I have read. I've looked at LISP before and do appreciate its elegance, but Python has a beauty of

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On 4 Aug, 16:50, John Nagle [EMAIL PROTECTED] wrote: Wilson wrote: Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why

Re: Limits of Metaprogramming

2008-08-04 Thread castironpi
On Aug 4, 4:48 am, Wilson [EMAIL PROTECTED] wrote: Hi all, My problem is that I don't know if it's possible to edit these states and then write them back to .py. Firstly, if my editing tool was to create a new state, I would want to create the class (using type) and attach it to the imported

Re: Limits of Metaprogramming

2008-08-04 Thread Wilson
On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: On Aug 4, 4:48 am, Wilson [EMAIL PROTECTED] wrote: Hi all, My problem is that I don't know if it's possible to edit these states and then write them back to .py. Firstly, if my editing tool was to create a new state, I would want to

Re: Limits of Metaprogramming

2008-08-04 Thread castironpi
On Aug 4, 1:57 pm, Wilson [EMAIL PROTECTED] wrote: On Aug 4, 6:49 pm, castironpi [EMAIL PROTECTED] wrote: Two, if all your methods will have uniform signatures and closures, you can store class methods as only their co_code objects: C.g.im_func.func_code.co_code 'd\x00\x00S' And