freenode/#mezzano - IRC Chatlog
Search
21:19:40
fittestbits__
fat12, fat16 and fat32 are fine for the class names, the problem is when a variable can be an instance of any one of those classes, then the variable shouldn't be fat32 as that makes it look like it should only be instances of fat32.
21:20:49
ebrasca
fittestbits__: I don't know how to name it. I have think in fat but it is file-allocation-table.
21:20:56
fittestbits__
And, yes, names are hard. In fact, the way I know when I'm done coding is when I stop changing the function and variable names.
21:22:43
fittestbits__
There's fat and fat32 - fat is the file allocation table (array), fat32 is the fat structure instance of fat12, fat16, or fat32. I think fat is fine, but fat32 should be something else, maybe fat-struct?
21:26:51
fittestbits__
No, when you create a fat32 host, you set the fat-structure field to (read-fat32-structure ...) similarly for fat12 and fat16 hosts. Then in the code you say (let ((fat32 (fat-structure host))) ...).
21:27:49
fittestbits__
Instead I think something like (let ((fat-struct (fat-structure host))) ...) - something more generic that fat32 because it could be an instance of fat12 or fat16.
21:29:24
fittestbits__
Sure, for those cases, but in open-using-host, which is supposed to work for all three file system types, using the variable fat32 is confusing.
21:32:09
fittestbits__
I'm not suggesting changes where you know which file system type it is like http://ix.io/23eI. It makes sense (let ((fat16 (read-fat16-structure ...))) ...) but for (fat-structure host), it doesn't make sense to use fat32 because it could be a fat12 or fat16.
21:37:04
fittestbits__
I'm still confused - does fat32-host work for fat12 and fat16? It must if open-using-host is supposed to work for fat12 and fat16. So shouldn't the name be fat-host instead of fat32-host?
21:37:54
fittestbits__
I been reading the spec - I think a single mount function will work as we can determine fat12/fat16/fat32 by looking at the boot sector.
21:40:12
fittestbits__
There's a section in the spec I found that goes through how to determine the file system type by looking at just values in the boot sector.
21:41:13
fittestbits__
The spec is very specific with lots of warning about common mistakes people make when writing the code.
21:42:14
fittestbits__
Anyway, the point is the code is supposed to work for all three file system types the way it is. I'm pretty sure I broke the code for fat12 and fat16 when I added the fat dirty bits.