lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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

But thankfully in my world "dead" is a Boolean quantity - I do not have to
contend with ghosts!

-----Original Message-----
[] 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:

- Jim

Attachment: smime.p7s
Description: S/MIME cryptographic signature