From: Hal Fulton Date: 2004-02-20T15:58:48+09:00 Subject: Re: how to raise warning? Gavin Sinclair wrote: >>Hi, >> >>In message "Re: how to raise warning?" >> on 04/02/19, "Robert Klemme" writes: >> >>|warn "#{__FILE__}:#{__LINE__}: there is an error" >> >>Do you guys expect "warn" to prepend the place information before the >>message? >> >> matz. > > > > I don't. A warning is often a user-level piece of information that does > not warrant file and line information. > > Having a variant of 'warn' that displays that information would be nice IMO. > > warn "You didn't provide such and such", true Mmm. I would expect that just to print 'true' after the warning. The problem as I see it is that we use warnings in two ways: 1. As Ruby does, to complain about something happening at a specific place in the source -- a highly source-related message. In that case, I'd want to see file/line info (as Ruby does when it says I need to add parens or something). 2. To complain about some general condition occurring at runtime that doesn't warrant bailing out of the app. My suggestion: Two names. Call the first one "warning" (the kind of warning that Ruby gives us) and the second one "warn" (a simple verb that just prints to stderr). Hal