[REBOL] Re: open? opened? close? closed? for schemes and ports
From: greggirwin:mindspring at: 20-Aug-2002 17:29
Hi Norman,
<< So when I understand correclty then Rebol does not have a function
that displays all the extra words created after boot-up, which is
by itself currious because i would expect that Rebol is using a
buffer where it keeps its extra added words! objects! etc... >>
Only the global context can grow. Other contexts cannot have words added to
them, but the global context does allow that.
<< Yes, as you say, that leaves me searching all the words but then again
how do i know what was opened or closed or created befor I entered
the console...Or even..when i execute a script from within the console
i would love to see a summery of what it all created on words! objects!
etc... I cant emagine this does not exist because this way you take out
the control ...MMmm... >>
Check out QUERY. People have used it to find which words were created by a
script.
<< Right now im trying to discover the meaning of the state: object!
when a port is opened, I see some differences in flags and func
when a port is closed or opened.. Perhaps a rebol guru could explain me
the details of the state object! ? >>
I think the details are meant for internal use only as they may change
between versions. Here is what Paul Tretter came up with for checking to see
if a port is open.
open?: func [port][either port/state/flags = 1024 [false][true]]