From: Ilias Lazaridis Date: 2011-06-21T01:10:35+09:00 Subject: Re: RFC - One word alias for require_relative On 20 Ιούν, 16:54, Christopher Dicely wrote: > 2011/6/17 Ilias Lazaridis : > > > On 17 Ιούν, 21:17, Gary Wright wrote: > >> I can't believe I'm adding to this conversation... > > >> Ruby already has an idiom for naming two related methods so how about: > > >> require "a/b"        # the usual > >> require! "a/b"       # require relative to __FILE__ > > > This could become my new favourite. > > > "!" is used as a convention, to clarify that a method "modifies the > > object" > > This misstates the existing convention; see below. ok > > "!" could be used for stand-alone functions (e.g. the "flat" Kernel > > functions which do not operate strictly on an object) to clarify (by > > convention) "you should know what you do, possible risks" or simply > > "alternate implementation". > > This second thing is actually the current convention for "!" for > normal methods (e.g., not just "flat" Kernel functions.): "!" > indicates a more-dangerous alternative when the base name is already > used. Which would mean the rule apply, and the question is: Is "require_relative" more dangerous than "require", thus "require!" would fit the naming-convention? I say: yes, because you can include everything from your source-tree, where "require" loads only from predefined paths. > It doesn't always indicate a mutating method, and mutating > methods don't always have it. ok > OTOH, require_relative is much more clear as to what it is doing than > require! would be, amd. This is not the topic. > anyway, require! is 8 characters, not 7. The requirement "7 chars" was an optional one. . -- http://lazaridis.com