5 ms·
Great article, thanks for writing that. A small question for the author: in the Addressable_intf.S signature, read_byte has regular arguments and write_byte nam
by Zababa 5y ago
Great article, thanks for writing that. A small question for the author: in the Addressable_intf.S signature, read_byte has regular arguments and write_byte named arguments. Is there a reason for that?
- linoscope 5y agoThanks! I added labels based on the number of arguments. `write_byte` has two arguments (other than `t`), the `addr` and `data`, so I used labeled arguments to distinguish the two easily. On the other hand, `read_byte` only has one argument, so I didn't label the argument. I saw this approach used in some Jane Street libraries: for example, `Hashtbl.set` takes two arguments and is labeled, while `Hashtbl.find` only has one argument and is not labeled. But I was sometimes confused and wrongly provided labels to `read_byte`, so looking back at it now, maybe I should have just labeled both functions for consistency.
- Zababa 5y agoThanks for the explanation, that makes a lot of sense.