From c014c6a88270afa8bec2d06ed9e8db4370769d5c Mon Sep 17 00:00:00 2001 From: Qualadore Date: Tue, 11 Jul 2023 10:59:34 +0000 Subject: [PATCH] Clarify uniqueness --- rfcs/function-debug-id.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rfcs/function-debug-id.md b/rfcs/function-debug-id.md index 37b21cea..2b8e8799 100644 --- a/rfcs/function-debug-id.md +++ b/rfcs/function-debug-id.md @@ -2,7 +2,7 @@ ## Summary -Add `debug.id` which accepts a value and always returns the identifier unique to that value. +Add `debug.id` which accepts a value and always returns the identifier unique to all values that haven't been garbage collected. ## Motivation @@ -12,7 +12,7 @@ When debugging, it is often useful to compare identity. Usually `print` will pri ## Design -`debug.id(value: string | userdata | table | thread | function): number` always returns the identifier unique to that value, and is not possible to override. +`debug.id(value: string | userdata | table | thread | function): number` always returns the identifier unique to that value, and is not possible to override. Uniqueness is only guaranteed for values that haven't been garbage collected. While tables and userdata have individualized metatables, also allowing functions and threads to be passed to `debug.id` would let their type-level `__tostring` be redefined. Strings are useful to accept because of long, similar strings.