Thursday, March 21, 2024

Nested Classes — thoughts and workarounds

Hello community,

I've been playing with some idea which has brought me to needing Nested Classes in Vim. I am curious what you think about this? Would this be too much for Vimscript? If not, what current workarounds would you suggest?

Context: I'm taking a stab at parsing protobuf definitions into Vim 9 classes. Nested messages in the protobuf demands nested structs/classes. 

Constraints:
  • (strong) All code-gen must be in vim9script; else how would the language gain popularity?
  • (weak) All definitions should be in one file
Current workarounds
  1. Regress into old VimL and use functions as classes. Then define internal "structures" as internal functions.
  2. Create a directory where each file is a top-level message class
  3. (current winner) Flatten the nesting, but only export top-level messages
What do you think? How can I approach this better?

Best,
Igbanam

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAOmRJrd9ga0nGchBL%2BKD%3Dp0SWNVj8DtUH_sxuXXFtO-m%3DwVHMQ%40mail.gmail.com.

No comments: