[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: improving the Lua manual?
- From: "John Hind" <john.hind@...>
- Date: Tue, 19 May 2009 15:24:51 +0100
isDeadOrGhost = UnitIsDeadOrGhost(unit) or UnitIsDeadOrGhost("fullname")
I'd not enclose formal names of strings in quotes as that invites confusion
with string literals and rather than using "or" I'd write this:
isDeadOrGhost = UnitIsDeadOrGhost(unitid)
isDeadOrGhost = UnitIsDeadOrGhost(fullname)
Returns 1 if the player is dead or a ghost, otherwise nil. 'Unitid' is a
number identifying a unit. 'Fullname' is the name of a player as a string.
I find the main source of confusion for readers of this kind of
documentation is "level shifting" i.e. understanding which bits of the
description are parts of the syntax being described and which bits are
notation used to describe, and you invite confusion by using the same
symbols in the same context at both levels ('or' and quoted literals in this
case).
But thankfully in my world "dead" is a Boolean quantity - I do not have to
contend with ghosts!
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jim Whitehead II
This is precisely what we use for documentation of the World of
Warcraft API. All API functions are stored as simple Lua tables that
are then expanded into function signatures. Where necessary, details
of the specific arguments are given. Some examples:
http://wowprogramming.com/docs/api/GetItemInfo
http://wowprogramming.com/docs/api/UnitIsDeadOrGhost
http://wowprogramming.com/docs/api/GetRaidRosterInfo
- Jim
Attachment:
smime.p7s
Description: S/MIME cryptographic signature