Re: Re: New stackless proposal
Paul Prescod <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Mark Hahn wrote: >... >>I notice you use a wrapping model here rather than an inheritance >>model (opposite of properties). OSThread looks like a wrapper. > > > It is an inheritance model. I see nothing in the example to indicate that OSThread inherits from thread1 or vice versa. > ... It just happens to reuse the thread1 binding. Can you see how that makes it more difficult to read the code? >>I don't understand why you use call_ to arm a thread and then rebind >>the name. If the call_ function mutates the underlying object then >>why do >>you have to rebind the name? > > > That is a mistake. I will change it to remove the assignment: > > thread1(10) # call thread1 to "arm" it I think using call_ for this is confusing. If you really feel like you have to use call_ it would be a lot more clear to use it for starting. But perhaps better not to use it at all. thread1.setParams(10) thread1.start() Explicit is better than implicit! Paul Prescod