From: Conrad Schneiker Date: 2000-03-25T12:35:20-06:00 Subject: [ruby-talk:02161] Re: ARGF vs. $< From: Dave Thomas > schneik@us.ibm.com writes: > > > Matz wrote: > > > on 00/03/23, Dave Thomas writes: > > > > > > |Apart from the naming convention, is there a reason that ARGF is > > > |documented as a global constant and $< as a global variable? They both > > > |reference the same object, and effectively have the same semantics. Am > > > |I missing something subtle here? > > > > > > They are same in semantics, but syntactically, $< is a read-only > > > special variable, and ARGF is a constant. In reference manual, I > > > cannot ignore syntactical difference. > > > > I don't know if Dave also wants to include the following in his > > documentation, but in English.rb there is also: > > > > alias $DEFAULT_INPUT $< > > I'm documenting English.rb in the section on library files, although > matz dislikes it as a Perl-ism ;-) Very strange that this rather uncharacteristic add-on to make Perl more readable and more self-documenting would be regarded as a Perl-ism. Besides, IIRC, some of these items were originally from awk. :-) I would have preferred a more terse/compact/abbreviated set of names instead of symbols and aliases. For example, $DEF_IN would seem to be the Aristotelian Ruby mean between the Perl-ish $< and the Cobol-ish $DEFAULT_INPUT. Maybe someday if Ruby makes a Perl4 to Perl5 or Python 1.6 to Python 3000 type of transition in a few years, then.... :-) > However, I'd forgotten to cross > reference that from my (overly long) table of predefined variables, so > thanks for the timely reminder. You're welcome, Conrad