Contexts

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Contexts

Post by newdep »

Hello Lutz,

How can i display all generated namespaces under newlisp? For the GUI-TK version you have this seperated window which contains all known Contexts, in the console mode a function like (contexts) would be very nice to have..

> (contexts)
( MAIN a PERSONS testing )


Regards, Norman.

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Hello newdep,

From newLISP-tk.tcl

(filter (lambda (x) (context? (eval x))) (symbols 'MAIN))
Hans-Peter

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Hello HPW,

Aaaa Thanks !!! Ill have a look in the code...
Nifty function btw.. ;-)

Norman.

nigelbrown
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia

Post by nigelbrown »

A variation:
(filter context? (map eval (symbols)))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Thank you for the tips, because i was just looking for way on how to
get ALL the variables displayed in a context and i did not expect (symbols) to work on context too ;-) nice nice...

Norman.

Locked