Open m0ose opened 1 year ago
I agree! "Private", as per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields ..looks pretty useful. Have you tried it?
I'm surprised that all the browsers support it, and so quickly.
I haven't used the private class fields. It looks well supported, https://caniuse.com/mdn-javascript_classes_private_class_fields
This is more difficult than it seemed. Turns out use of private variables is class based but AS makes heavy use of prototypal methods. So this basically depends on: https://github.com/backspaces/agentscript/issues/83
Could it be renamed to something less common like id ?
On Wed, Oct 4, 2023, 9:53 AM Owen Densmore @.***> wrote:
This is more difficult than it seemed. Turns out use of private variables is class based but AS makes heavy use of prototypal methods. So this basically depends on: #83 https://github.com/backspaces/agentscript/issues/83
— Reply to this email directly, view it on GitHub https://github.com/backspaces/agentscript/issues/78#issuecomment-1747193848, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADADQRUJODL37PYQY553XLX5WBA3AVCNFSM6AAAAAA4DOQXQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGE4TGOBUHA . You are receiving this because you authored the thread.Message ID: @.***>
It turns out that it turtle list is sorted by id, and if you set the id it will mess some internal things, like turtle removal.
Maybe the turtle id should be private, or have a setter that gives you a warning to avoid shooting yourself in the foot?