Say you'd have a [global] object, with a getter and / or setter for things like dsp, samplerate, version etc. Obviously, some things are gettable but not settable, like version or path/to/pd, and some things are not even gettable in certain circumstances, like IOhannes pointed out. The object would then give an error message which you can catch. For local info you'd have another object, for example [this] for the window, (like MaxMsp has [thispatcher]).
Katja