more contexts

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

more contexts

Post by newdep »

Probably a real easy one, but i cant find it ;(

How can I see how many and what contexts are currently active?

Norman.
-- (define? (Cornflakes))

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Maybe like this (run from MAIN context):

Code: Select all


(dotimes (x (length (symbols))) (if (context? (eval (nth x (symbols)))) (println (nth x (symbols)))))

Or is this not what you are looking for?

Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Even faster:

Code: Select all


(dotree (s MAIN)(if (context? (eval s)) (println s)))


Peter

Locked