bstruct icon indicating copy to clipboard operation
bstruct copied to clipboard

✨ Support native primitive types

Open bdsoha opened this issue 1 year ago • 2 comments

Support native primitive built-in types (similar to the existing bool implementation):

  • intbstruct.i32
  • floatbstruct.f64

bdsoha avatar Nov 19 '23 07:11 bdsoha

Hi, sorry for the late reply. I have mixed feelings about this. IMO the added convenience of less typing for i32 and f64 does not outweigh the costs of having less explicit information when looking at a class definition, as the choice to select i32 and f64 for int and float respectively is a bit arbitrary (i.e. why not i64 and f64 or i32 and f32). Or do you have another use case I am not seeing here?

flxbe avatar Dec 01 '23 11:12 flxbe

Hey,

I understand your point, and that is why int and float have been added as an additional options. They don't replace the previous implementation of i32, i64. Think of it as syntactic-sugar for those that prefer a convention-first approach.

bdsoha avatar Dec 03 '23 06:12 bdsoha

Hi, sorry for the very late reply. I still don't see a compelling enough reason to add surface area to the API only for convenience, especially since the choices of which exact types int and float are resolved to are somewhat arbitrary and therefore potentially surprising. I will close the PR.

flxbe avatar Jul 16 '24 17:07 flxbe