so it is possible to distinguish this, but I get the point.
Maybe allowing this when size is specified all the time (and is nonzero and matches) would make some sense to me - so only 4 parameter variant with nonzero size would support preallocated size use case. But maybe it can be said about three parameter variant too since once you start using offsets it is this case of using preallocated files. So having it as jsvar would make same sense and looks easier to use. So with that it would allow different semantics
one time write possible = two parameters only
multiple writes with preallocated size - 3 or 4 parameters - in this case writing to any offset including 0 should be possible (as long as data underneath currently written part is all FF).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I am giving the size too so it is actually like
while your example would be equal to
so it is possible to distinguish this, but I get the point.
Maybe allowing this when size is specified all the time (and is nonzero and matches) would make some sense to me - so only 4 parameter variant with nonzero size would support preallocated size use case. But maybe it can be said about three parameter variant too since once you start using offsets it is this case of using preallocated files. So having it as jsvar would make same sense and looks easier to use. So with that it would allow different semantics