The documentation for ENVPROP is identical with the documentation for ENVPROPSTR; however, ENVPROP returns #-1 and an integer 0, if the property isn't found, rather than a null string. It should read:
ENVPROP ( d s -- d ? )
Takes a starting object dbref and a property name and searches down the environment tree from that object for a property with the given name. If the property isn't found, it returns #-1 and 0. If the property is found, it will return the dbref of the object it was found on, and the value it contained.
It'd also be handy to add "Also see: ENVPROPSTR" to the ENVPROP doc, and vice versa.
A question: should the documentation match the code, or should the code match the documentation? The typical sequence for ENVPROP has:
[#0 "_connect"] ENVPROP swap dup #-1 = ( failed to find) if pop pop else (found it) [do whatever] then
The code can be made to match the documentation very simply, or the documentation can be made to match the code very simply. What would the better course be?
I would suggest making the documentation match the code, as changing the code may break existing programs, while changing the docs will just clarify what's currently in place.
I concur. Change the docs to match the code so we don't break existing tested scripts.
Documentation changed.