Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ruby Programming Language

Question about getc


Hi,

In message "Re: Question about getc"
    on Tue, 5 Jun 2007 19:15:06 +0900, "Sun Park" <geniusleo@gmail.com> writes:

|If we call gets(), the returned string is copied to a special variable $_
|Do we have such things for getc(), too?

No, implicit global variables are evil.  I'd rather remove $_ in the
future.

                                                        matz.

On Jun 5, 2007, at 8:55 AM, Sun Park wrote:

> I use global variables for golfing only.. :) but please don't  
> remove $_!

This is probably a good argument for removing the variable.  ;)

James Edward Gray II

On 6/5/07, Yukihiro Matsumoto <m@ruby-lang.org> wrote:

> Hi,

> In message "Re: Question about getc"
>     on Tue, 5 Jun 2007 19:15:06 +0900, "Sun Park" <geniusleo@gmail.com> writes:

> |If we call gets(), the returned string is copied to a special variable $_
> |Do we have such things for getc(), too?

> No, implicit global variables are evil.  I'd rather remove $_ in the
> future.

>                                                         matz.

Oooooh, I love it when matz talks like that!
http://talklikeaduck.denhaven2.com/articles/2007/06/05/money-is-the-r...

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On 6/5/07, James Edward Gray II <j@grayproductions.net> wrote:

> On Jun 5, 2007, at 8:55 AM, Sun Park wrote:

> > I use global variables for golfing only.. :) but please don't
> > remove $_!

> This is probably a good argument for removing the variable.  ;)

> James Edward Gray II

As both a dedicated Rubyist, and an astronomically high-handicap USGA
member, I'm all for getting rid of both $_ AND golfing from Ruby.
Golf is for getting away from the computer. <G>

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Hi,

Am Dienstag, 05. Jun 2007, 22:48:55 +0900 schrieb Yukihiro Matsumoto:

> [...] implicit global variables are evil.  I'd rather remove $_ in the
> future.

I _never_ use $_ in any 'def'ed method but I use it in
_every_ '-ne'/'-pe' oneliner. Please keep it.

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc