From 3a77768faef5a5d7c6155f3e668d87ca7e7f1b27 Mon Sep 17 00:00:00 2001 From: Junseo Yoo Date: Wed, 3 Jul 2024 13:30:24 -0700 Subject: [PATCH] merge addprop() and delprop() into one --- docs/user-defined-type-functions.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/user-defined-type-functions.md b/docs/user-defined-type-functions.md index ac79a51..5e61351 100644 --- a/docs/user-defined-type-functions.md +++ b/docs/user-defined-type-functions.md @@ -150,8 +150,7 @@ All attributes of newly created typelib are initialized with empty tables / arra | Instance Methods | Return Type | Description | | ------------- | ------------- | ------------- | -| `addprop(key: typelib, value: typelib)` | `nil` | adds a key, value pair to self's table properties; if the same key exists already, overrides the value | -| `delprop(key: typelib)` | `nil` | removes the key from self's table properties along with the value associated with it; if the key doesn't exist, nothing happens | +| `setprop(key: typelib, value: typelib?)` | `nil` | adds / overrides (if same key exists) a key, value pair to self's table properties; if value is nil, removes the key, value pair from self's table properties; if the key does not exist and the value is nil, nothing happens | | `getprop(key: typelib)` | `typelib?` | returns the value associated with the key from self's table properties if the key exists, else nil | | `getprops()` | `{[typelib]: typelib}` | returns a table of self's table properties (e.g. `{["age"] = 20}` will return `{typelib.getstringsingleton("age") = typelib.getnumber()}`) | | `setindexer(key: typelib, value: typelib)` | `nil` | sets self's indexer key type to the first argument and indexer value type to the second |