Echo Hollow

Gender-Bending Interactive Stories! :D

User Tools

Site Tools


smutbook:classes:util:array_prototypes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
smutbook:classes:util:array_prototypes [2026/08/25 12:45] leesmutbook:classes:util:array_prototypes [2026/08/25 13:58] (current) – removed lee
Line 1: Line 1:
-====== Array Prototypes ====== 
- 
-===== Array.prototype.commaList() ===== 
- 
-Returns a proper serial-comma-separated string list of the list elements' toString() values, including "and", or "nothing" if the list is empty. 
-<code> 
-// Returns "a two-dollar pistol, a Stetson hat, and a shotgun": 
-[ "a two-dollar pistol", "a Stetson hat", "a shotgun" ].commaList()  
- 
-// Returns "a two-dollar pistol and a Stetson hat": 
-[ "a two-dollar pistol", "a Stetson hat" ].commaList() 
- 
-// Returns "a two-dollar pistol": 
-[ "a two-dollar pistol" ].commaList() 
- 
-// Returns "nothing": 
-[].commaList() 
-</code> 
- 
-===== Array.prototype.CommaList() ===== 
- 
-As above, but with the first letter of the returned string capitalized. 
- 
-===== Array.prototype.aList =====  
- 
-Assuming an array of PersistentObjects (or subclasses thereof) or persistent object IDs (may be mixed), returns a serial-comma-separated description like .commaList(), but using those objects' .aName methods. 
-<code> 
-// Assuming pistol and shotgun are valid PersistentObjects, and "hat" is the id of a valid  
-//  PersistentObject, returns "a two-dollar pistol, a Stetson hat, and a shotgun": 
-[ pistol, "hat", shotgun ].aList()  
-</code> 
- 
-===== Array.prototype.AList() ===== 
- 
-As above, but with the first letter of the returned string capitalized. 
- 
-===== Array.prototype.theList =====  
- 
-Assuming an array of PersistentObjects (or subclasses thereof) or persistent object IDs (may be mixed), returns a serial-comma-separated description like .commaList(), but using those objects' .theName methods. 
-<code> 
-// Assuming pistol and shotgun are valid PersistentObjects, and "hat" is the id of a valid  
-//  PersistentObject, returns "the two-dollar pistol, the Stetson hat, and the shotgun": 
-[ pistol, "hat", shotgun ].theList()  
-</code> 
- 
-===== Array.prototype.TheList() ===== 
- 
-As above, but with the first letter of the returned string capitalized. 
- 
-===== Array.prototype.nList =====  
- 
-Assuming an array of PersistentObjects (or subclasses thereof), or persistent object IDs, or functions (may be mixed), returns a serial-comma-separated description like .commaList(), but using those objects' .name fields.  Useful for things like "your such-and-suches". 
-<code> 
-// Assuming pistol and shotgun are valid PersistentObjects, and "hat" is the id of a valid  
-//  PersistentObject, returns "two-dollar pistol, Stetson hat, and shotgun": 
-[ pistol, "hat", shotgun ].theList()  
-</code> 
- 
-===== Array.prototype.NList() ===== 
- 
-As above, but with the first letter of the returned string capitalized. 
- 
  
smutbook/classes/util/array_prototypes.1787687109.txt.gz · Last modified: by lee