Re: Euphoria Object Oriented Programming
	
	
	
	
Hi Jason,
1)It's not about closure but namespaces. Namespaces are very usefull to avoid 
naming conflict but also to groups functions and data like in oop except 
in a simpler (and limited) way. Obviously the same could be done by creating 
a lot of small includes files. But I think it would be usefull to be able 
to declare many namespaces inside a single file.
2) How often I do something like that in my coding:
integer a   a= 10
sequence test  test = "ceci est un exemple"
a lot of typing for nothing
I would appreciate to be able to do.
integer a= 10
sequence test="ceci est un test"
3) I see myself often declaring variables outside procedures (functions) for the
the only usage of a single procedure (function) to keep persistant state between
call. I don't think such variables should be declared at top level.
I won't talk about closure here, although I read about it in wikipedia I don't
grasp the concept completely.
regards,
Jacques Deschênes
 
Jason Gade wrote:
> 
> jacques deschênes wrote:
> > 3) persistant variables inside procedures and functions
> > procedure proc(integer n)
> > persist atom a=0,b=0 -- need feature 2 above
> >   a += 10*n
> >   b = n/10
> > end procedure
> > those persistents objects would be stored in global space as top level
> > objects
> > 
> > regards,
> > Jacques Deschênes
> 
> I think you can do this with the multitasking. At least I've assumed as much
> even though I haven't tried it.
> 
> I think Euphoria's multitasking essentially creates closures.
> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> "Premature optimization is the root of all evil in programming."
> --C.A.R. Hoare
> j.
	
	
		| 
									Not Categorized, Please Help
						 |  |