Re: Phix : nested structs
- Posted by petelomax 1 week ago
- 113 views
What are the arguments against structs and classes, and what should replace them?
They can be noticeably slower than plain sequences, without offering much benefit, unless you happen to think s.field vs s[FIELD] is a game-changer, and they're not debug-friendly.
Plus as you've already found out that something like s[i].field and/or s.i.field is simply not supported, whereas in contrast there is no hindrance of any kind whatsoever on s[i][FIELD].
I haven't yet managed to dream up any replacement, maybe something'll crop up in time for 2.1... Go and/or Rust might yet inspire me, they do something neater/simpler than most.
(Then again, I'm not exactly enamoured by either syntax offerings, and certainly rather averse to those kinds of harsh, draconian, nit-picking, and downright fussy type systems.)

