call 'the following function' using decorators

castironpi at gmail.com castironpi at gmail.com
Sun Feb 17 15:43:01 EST 2008


On Feb 15, 7:54 pm, castiro... at gmail.com wrote:
> > > > > I assert it's easier to write:
>
> > > > > start_new_thread( this_func )
> > > > > def thrA():
> > > > >     normal_suite()
>
> > > > > than
>
> > > > > def thrA():
> > > > >     normal_suite()
> > > > > start_new_thread( thrA )
>
> > > > > If you don't, stop reading.
>
> Nothing beats if forkthread(): but what are the chances of getting it
> in Python?

AIR, as I recall, the SML equivalent is:

var TM: thread_manager

in

def forkthread():
   TM.add( True, False )

in

if forkthread() thing_to_do() else other_thing_to()


where programs can refer to a thread_manager along with a memory,
which yes, is even in a functional language, well-defined.
thread_manager altertantely beta-reduces one expression at a time in
round-robin succession.  thread_manager.add duplicates the current
expression, and evaluates to True in one and False in the other.






More information about the Python-list mailing list