dyllongagnier
2020-9-27 10:08:32

@dyllongagnier has joined the channel


kellysmith12.21
2020-9-27 14:43:14

Is it good practice to use type-specific equality procedures (e.g. char=?) instead of the generic equality procedures?


sorawee
2020-9-27 14:57:21

For readability, I prefer type-specific equality. It also produces an error when the contract is violated instead of failing silently. The downside, of course, is that it could be less efficient in a tight loop, since it needs to check for contract violation (especially when the alternative is eq? which is super fast).


notjack
2020-9-27 23:11:20

For readability, I prefer always using equal?


notjack
2020-9-27 23:12:48

It makes things much easier when you don’t have to ask yourself which equality procedure to use or whether a given choice of equality procedure in some block of code is optimal


steven
2020-9-27 23:23:16

@steven has joined the channel


dyllongagnier
2020-9-28 06:47:29

I mostly agree with @notjack but eq? is actually useful sometimes for pointer equality (== in Java). However, even for number types I would use equal? for clarity and only use eq? if you need the special behavior rather than as an optimization.