Open hansihe opened 7 years ago
I think you misunderstand what argument for native types does.
It declares a slot where you can pass an argument when using the type.
Is this thing needed? May be cstring should be implemented in native instead of defining it?
@Creeplays Sure, cstring would probably be implemented as a native type.
The reason we need this is mainly because of other things. An example of this is the NBT format, where a compound tag is a list of named values until a terminator tag.
What about implementing new syntax for this? Like this:
array(terminator: "0") => container {};
That would work for that one specific case, but it's not a general solution, and it doesn't scale to other things.
For it to be a truly general solution, it would need to compose well with the other parts of the language.
https://github.com/ProtoDef-io/ProtoDef/issues/8
Or maybe
match: "0"
ormatch: 0
, but accept different constant types?