@simon_paul58 has joined the channel
so i presume the snapshot builds (the x64 unspecified ) is cs?
Yes, unlabeled is CS
In general are explicit exceptions or #f
preferred? In the latter case, is there any good way to express multiple return values which can fail?
i.e. I have a function which returns values
or #f
I think, it depends.
Regarding the last question, you can solve it by returning an extra value: (values success? value1 value2 ...)
and then let the receiver check success? to see whether the values are valid.
Or, if the returned values are related, introduce a struct to hold the answer.
(and then skip using multiple values)
Yeah - I guess it feels weird to return redundant values though.
Yeah, not ideal.
I think I prefer the struct/list approach. I think it conveys intent better (or exceptions).
IMO: Choose exceptions if they are not meant to be handled, that is, the user should check themselves beforehand if the use case is valid. Otherwise return a specific value so the user can act depending on it.
Exceptions signal abnormal behaviours
It’s tricky - I think for functional code that makes perfect sense and the boundaries are clear. But I’m quite used to encoding failure states as data coming from other functional languages (say a file handle is missing, or some permissions issues).
Typically it’s because I want to force the user to actually check the return value/handle the error. In Racket this feels less clear, because it’s not enforced at compile time anyway.
Definitely use a struct to bundle the values together if you can (which is when the number of values is fixed and you can pick sensible names for the struct fields that would contain them)
is libracketcs_bq4bwg.dll
in the lib folder when distributing an exe, supposed to be 38MB? i notice chezscheme executables are double that of bc(well, its adding +38MB)
@notjack Is that with returning #f
or throwing?
Either way, honestly
but especially when returning #f
I guess the last part of it is that I lose the stack with #f
, esp. if users aren’t careful.
is raco distribute
working for those on cs snapshot?
nevermind, its working now
image=?
seems to not be available in htdp2/image … is there another way to check if 2 images are the same?(cant import both htdp and htdp2) i presume i need to run them through a hash?
What do you want the comparison to do?
You can just use equal?
But that won’t often give the answer you want, probably
i want the comparison to check if two images are equal, has to be exactly equal
equal? is accurate enough?
seems like it works, thanks
@d.zivertas has joined the channel