anonymous contexts

Started by sunsetandlabrea, March 17, 2005, 08:41:18 AM

Previous topic - Next topic

sunsetandlabrea

Hello,



I'm still trying to learn.



I want to use contexts as a sort of object but somehow want to create anonymous contexts.



For instance in Delphi I have a class with a few attributes and a number of methods. I can recreate this in newLisp using contexts but in Delphi it is quite easy to create hundreds of these objects and assign each one to some sort of list. Afterwards I can iterate through the list with a simple index.



In newLisp though I have to name each context and so I can't see how I could do a similar thing.



Any help would be greatly appreciated.



Thanks,



Richard

Lutz

#1
Contexts in newLISP are name spaces and named itself by a name in the MAIN context, so they are no anonymous contexts.



If you want a big number of context objects created dynamically you could use the 'sym' function to create names for them on the fly and you can use normal variable symbols to refer to context objects dynamically. There are examples for this in the manual.



Lutz

sunsetandlabrea

#2
Thanks Lutz that is just the kind of thing I'm looking for.



Richard