Menu

#269 'man envprop' gives incorrect information.

Miscellaneous
closed-fixed
nobody
5
2015-05-06
2011-03-13
Pyro
No

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.

Discussion

  • Kyle Hamilton

    Kyle Hamilton - 2011-03-19

    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?

     
  • Pyro

    Pyro - 2011-03-20

    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.

     
  • Revar Desmera

    Revar Desmera - 2011-03-20

    I concur. Change the docs to match the code so we don't break existing tested scripts.

     
  • Wyld

    Wyld - 2015-05-06
    • status: open --> closed-fixed
     
  • Wyld

    Wyld - 2015-05-06

    Documentation changed.

     

Log in to post a comment.