Re: generator functions in another language

2008-05-06 Thread castironpi
On May 6, 1:00 pm, hdante <[EMAIL PROTECTED]> wrote: > On May 6, 12:28 am, [EMAIL PROTECTED] wrote: > > > > > > > > > There's a process decorator to functions in a module. > > > [supposes] > > > @process > > def datafile( processdict ): > >    processdict.modify( ) > >    op= yield > >    op.call(

Re: generator functions in another language

2008-05-06 Thread hdante
On May 6, 12:28 am, [EMAIL PROTECTED] wrote: > > There's a process decorator to functions in a module. > > [supposes] > > @process > def datafile( processdict ): >    processdict.modify( ) >    op= yield >    op.call( ) in processdict >    # op.call( ) in namespace > > More simply: > > @process > d

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 1:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 4, 1:11 pm, [EMAIL PROTECTED] wrote: > > > There is no such thing as a 'frame' per se in C; byte code is > > integral.  As there is no such thing as suspended state without > > frames, and no such thing as generators without

Re: generator functions in another language

2008-05-05 Thread [EMAIL PROTECTED]
On May 4, 1:11 pm, [EMAIL PROTECTED] wrote: > There is no such thing as a 'frame' per se in C; byte code is > integral. As there is no such thing as suspended state without > frames, and no such thing as generators without suspended state. Well, for implementing generators there are alternatives

Re: generator functions in another language

2008-05-05 Thread J. Cliff Dyer
On Mon, 2008-05-05 at 10:08 -0700, [EMAIL PROTECTED] wrote: > At some point, code goes "on" and "off" the processor, which knowledge > I do owe to spending money. Thus, if the group news is a localcy > (other dimension of currency), that's bounce check the house dollar. > What do [second person pl

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 12:28 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 00:09:02 -0300, hdante <[EMAIL PROTECTED]> escribió: > > > > > > >  Isn't this guy a bot ? :-) It's learning fast. I believe there is a > > "frame" in C, composed of its stack and globals. For generators in C,

Re: generator functions in another language

2008-05-04 Thread Gabriel Genellina
En Mon, 05 May 2008 00:09:02 -0300, hdante <[EMAIL PROTECTED]> escribió: > Isn't this guy a bot ? :-) It's learning fast. I believe there is a > "frame" in C, composed of its stack and globals. For generators in C, > you may look for "coroutines". For example, see: > > http://www.chiark.greenend.

Re: generator functions in another language

2008-05-04 Thread Terry Reedy
A 'generator function' -- a function that when called returns a generator object, a specific type of iterator, is a rather Python specific concept. Better to think, I think, in terms of writing an iterator 'class' (in C, struct with associated function). Looking at the implementation of two o

Re: generator functions in another language

2008-05-04 Thread hdante
On May 4, 8:11 am, [EMAIL PROTECTED] wrote: > On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > > > En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL > > PROTECTED]> escribió: > > > > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > > > >> I'm act

Re: generator functions in another language

2008-05-04 Thread Gabriel Genellina
En Sun, 04 May 2008 08:11:35 -0300, <[EMAIL PROTECTED]> escribió: > On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL >> PROTECTED]> escribió: >> >> > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: >

Re: generator functions in another language

2008-05-04 Thread castironpi
On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL > PROTECTED]> escribió: > > > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > > >> I'm actually curious if there's a way to write a generator function >

Re: generator functions in another language

2008-05-04 Thread David
On Sun, May 4, 2008 at 1:39 AM, <[EMAIL PROTECTED]> wrote: > I'm actually curious if there's a way to write a generator function > (not a generator expression) in C, or what the simplest way to do it > is... besides link the Python run-time. > -- Here's the itertools C code: http://svn.python

Re: generator functions in another language

2008-05-03 Thread Gabriel Genellina
En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió: > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > >> I'm actually curious if there's a way to write a generator function >> (not a generator expression) in C, or what the simplest way to do it >> is

Re: generator functions in another language

2008-05-03 Thread Marc 'BlackJack' Rintsch
On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > I'm actually curious if there's a way to write a generator function > (not a generator expression) in C, or what the simplest way to do it > is... besides link the Python run-time. The reference implementation of Python is written in C, so o

generator functions in another language

2008-05-03 Thread castironpi
I'm actually curious if there's a way to write a generator function (not a generator expression) in C, or what the simplest way to do it is... besides link the Python run-time. -- http://mail.python.org/mailman/listinfo/python-list