Question about getc

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

Hi,

···

In message "Re: Question about getc" on Tue, 5 Jun 2007 19:15:06 +0900, "Sun Park" <geniusleonid@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.

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

···

2007/6/5, Yukihiro Matsumoto <matz@ruby-lang.org>:

Hi,

In message "Re: Question about getc" > on Tue, 5 Jun 2007 19:15:06 +0900, "Sun Park" <geniusleonid@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-root-of-all

···

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

Hi,

In message "Re: Question about getc" > on Tue, 5 Jun 2007 19:15:06 +0900, "Sun Park" <geniusleonid@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.

--
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

Sorry.. I mean 'implicit' global variables

···

2007/6/5, Sun Park <geniusleonid@gmail.com>:

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

This is probably a good argument for removing the variable. :wink:

James Edward Gray II

···

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

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

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>

···

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

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

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

This is probably a good argument for removing the variable. :wink:

James Edward Gray II

--
Rick DeNatale

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