Hi Mark, Mark H Weaver <m...@netris.org> skribis:
> l...@gnu.org (Ludovic Courtès) writes: >> However, could it be done in the tree-il/analyze.scm instead, along with >> other warning passes? > > The problem is that 'case' does not exist in tree-il. By the time > analyze.scm sees it, 'case' has been transformed into nested 'if's with > 'memv's. In theory, similar checks could still be done, but I don't see > how we could produce warning messages that are easy to understand. Indeed. >> The reason I’m asking is that this: >> >>> * module/system/base/message.scm (%warning-types): Add 'bad-case-datum' >>> and 'duplicate-case-datum' warning types. >> >> ... is really meant for compiler warnings (see, for instance, the output >> of ‘guild compile -Whelp’). In particular, whether the warnings are >> emitted is determined by a #:opts sub-option to ‘compile’. > > Hmm, good point. Maybe what we need here is something analogous to > 'syntax-violation', but for warnings. One of 'syntax-warning's > arguments would be the 'warning-type' (a symbol), to allow the warning > to be disabled. Sounds good. > One complication is that, in order to enable ordinary users to easily > add their own warning types for their macros, What about addressing this problem separately? :-) Thanks, Ludo’.