From: Harald Hanche-O. <ha...@ma...> - 2005-10-10 06:59:23
|
+ Christophe Rhodes <cs...@ca...>: | Harald Hanche-Olsen <ha...@ma...> writes: | | > Compiling this form: | > (compile nil (lambda (stream) (read-byte stream nil))) | > produces this spurious note: | > ; in: lambda nil | > ; (READ-BYTE STREAM NIL) | > ; --> BLOCK LET IF LET IF SB-IMPL::EOF-OR-LOSE IF ERROR | > ; ==> | > ; STREAM | > ; | > ; note: deleting unreachable code | | Ew. This is a place where the heuristics for whether the user should | know about some deleted code fall over. Note that | (compile nil '(lambda (s) (read-byte s nil))) | does not result in the compiler emitting diagnostics. Heh. That's amusing. | Probably the right fix for this case is to introduce a binding like | (let ((%stream stream)) | ... Hmm. Sounds like that could obfuscate the code base a bit, unless you manage to hide it with some clever macrology. Wouldn't it also carry a (minor) performance penalty? Or would the compiler realize that the binding really wasn't necessary after all, and remove it again? | at the start of READ-BYTE and similar functions, and then to use | %stream internally. If this still matters (and I realise that quite | a lot of time has elapsed since your report...) then a patch along | those lines would be looked at. It doesn't matter to me, in the sense that I certainly can live with this. Spurious compiler notes are a minor annoyance really. Their real cost is that if you have too many of them, then you tend not to discover the ones that really matter. I offered my report in the spirit of trying to be helpful, pointing out an area that could be fixed (as if y'all didn't know already, and as if you didn't already have your hands full). It could perhaps sit on the back burner until someone, some day, decides to take a stab at improving the quality of the compiler notes in a more comprehensive manner. - Harald |