Forum: Ruby Does `self` and `scope(local)` operate parallels?

Posted by Kumar R. (kumar_r)
on 2013-03-01 20:39
I am heavily confused with the topic when thinking `self` and `local
scope` together. It seems they worked in parallel. To understand the
same I tried the below code one with `self` :

>> class Foo
>> puts "#{self}"
>> class Bar
>> puts "#{self}"
>> end
>> def show
>> puts "#{self}"
>> end
>> end
Foo
Foo::Bar
=> nil
>> foo = Foo.new
=> #<Foo:0x21f9ed0>
>> foo.show
#<Foo:0x21f9ed0>
=> nil
>>

And the other with `local scope` as below:

>> class Foo
>> a = 5
>> class Bar
>> a=2
>> def show
>> a=11
>> p "show :: #{a}"
>> end
>> p "Bar :: #{a}"
>> end
>> p "Foo :: #{a}"
>> end
"Bar :: 2"
"Foo :: 5"
=> "Foo :: 5"
>> bar = Foo::Bar.new
=> #<Foo::Bar:0x1f8d650>
>> bar.show
"show :: 11"
=> "show :: 11"
>>

But still not clear to me.

Could anyone help me a solid example which would prove/show - if they
operate parallel or not?
Posted by Hans Mackowiak (hanmac)
on 2013-03-01 20:46
yes they work equal, because th scope is the same
Posted by Kumar R. (kumar_r)
on 2013-03-01 20:50
I am asking can it be seen with an example where `self` would change but 
in the same local scope and vice-versa.

Thanks
Posted by Hans Mackowiak (hanmac)
on 2013-03-01 21:00
self and the "local scope" are the same

and they only change when you do something like instance_eval or other 
stuff like Threads
Posted by Kumar R. (kumar_r)
on 2013-03-01 21:44
Just to help experts out there I am clearing my statement once again 
here:

"I am trying to understand if self can be changed without entering to a 
new local scope which is not the case in my example,where self has been 
changed in every local scope. And also to see the fixed self when local 
scope changing."
Posted by S.D (Guest)
on 2013-03-01 22:58
(Received via mailing list)
"Kumar R.": "YAATSGFY"

FYI: Kumar R. is another psuedonym for Love U Ruby, Arup Rakshit, Xavier 
R., Tukai Patra and possibly others.
He has proven to be a troll and a help vampire.

http://whatismyipaddress.com/trace-email

I used the website to determine the ip address originating from all of 
the above user email accounts and it was one and the same:

Source: The source host name is "eq4.andreas-s.net" and the source IP 
address is 188.40.52.210.

Geo-Location Information
Country   Germany
State/Region
City
Latitude   51
Longitude   9
Area Code

I hope this information helps others here to determine when a user 
becomes a nuisance and tries to hide his/her identity behind alternate 
user names.
I long for the old days when usenet users' posts were issued under their 
real names, and the discourse contained more useful information.

Since Jan. 1, 2013, the following are the message counts for this same 
user:

172 - Love U Ruby
137 - Arup Rakshit
38 - Xavier R.
11 - Tukai Patra
8 - Kumar R.
===========
366 messages

Nuff said.
Posted by Robert Klemme (robert_k78)
on 2013-03-02 00:47
(Received via mailing list)
On Fri, Mar 1, 2013 at 9:00 PM, Hans Mackowiak <lists@ruby-forum.com> 
wrote:
> self and the "local scope" are the same

Certainly not.  self is an object reference which cannot be changed by
the user. A scope is something that holds named object references
(local variables).  self can change
 - on method entry
 - when opening a class or module body
 - inside a block when executed via #instance_eval, #instance_exec,
#class_eval or #module_eval

Local scope changes
 - on method entry
 - inside blocks
 - inside class and module bodies

irb(main):001:0> def f(x=0)
irb(main):002:1> p self, local_variables.sort
irb(main):003:1> 1.times do |y|
irb(main):004:2* p self, local_variables.sort
irb(main):005:2> end
irb(main):006:1> p self, local_variables.sort
irb(main):007:1> end
=> nil
irb(main):008:0> f
main
[:x]
main
[:x, :y]
main
[:x]
=> [main, [:x]]

> and they only change when you do something like instance_eval

Correct.

> or other stuff like Threads

Wrong for self.

irb(main):015:0* p self
main
=> main
irb(main):016:0> Thread.new { p self }.join
main
=> #<Thread:0x802a8430 dead>

Kind regards

robert
Posted by tamouse mailing lists (Guest)
on 2013-03-02 00:55
(Received via mailing list)
On Fri, Mar 1, 2013 at 3:57 PM, S.D <s.d@comcast.net> wrote:
> "Kumar R.": "YAATSGFY"

This isn't in my acronym decoder. What is YAATSGFY?

> FYI: Kumar R. is another psuedonym for Love U Ruby, Arup Rakshit, Xavier R., 
Tukai Patra and possibly others.

It does seem rather curious and suspicious that someone would use so
many different names. OTOH, being a plural, I have a few headmates.
They don't interact here, though.
Posted by Ryan Davis (Guest)
on 2013-03-02 08:21
(Received via mailing list)
On Mar 1, 2013, at 13:57 , "S.D" <s.d@comcast.net> wrote:

>
> Geo-Location Information
> Country   Germany
> State/Region
> City
> Latitude   51
> Longitude   9
> Area Code

Huh... Maybe it IS Ilias! Any chance you can do an old mail from ilias 
to see how much it matches?
Posted by Kumar R. (kumar_r)
on 2013-03-02 08:32
Ryan Davis wrote in post #1099811:
> On Mar 1, 2013, at 13:57 , "S.D" <s.d@comcast.net> wrote:
>
>>
>> Geo-Location Information
>> Country   Germany
>> State/Region
>> City
>> Latitude   51
>> Longitude   9
>> Area Code
>
> Huh... Maybe it IS Ilias! Any chance you can do an old mail from ilias
> to see how much it matches?

please start a new thread to discuss such stupid things. I am getting
un-wanted emails in my inbox. You have too much time to compare such
things,do it as you like.I do have no problem. But not here. I started
this thread to get and also give some valuable information to other
people who comes here to resolve their queries. I am done.

Not here do such unwanted talk please.
Posted by Michel (Guest)
on 2013-03-02 15:42
(Received via mailing list)
Le samedi 02 mars 2013 à 06:57 +0900, S.D a écrit :

> "Kumar R.": "YAATSGFY"
>
> FYI: Kumar R. is another psuedonym for Love U Ruby, Arup Rakshit, Xavier R., 
Tukai Patra and possibly others.
> He has proven to be a troll and a help vampire.
>


The pseudonym "chandan mallik" also come from the same IP address !
Posted by Kumar R. (kumar_r)
on 2013-03-02 15:49
Michel wrote in post #1099829:
> Le samedi 02 mars 2013 à 06:57 +0900, S.D a écrit :
>
>> "Kumar R.": "YAATSGFY"
>>
>> FYI: Kumar R. is another psuedonym for Love U Ruby, Arup Rakshit, Xavier R.,
> Tukai Patra and possibly others.
>> He has proven to be a troll and a help vampire.
>>
>
>
> The pseudonym "chandan mallik" also come from the same IP address !

See do one thing. Mention the same on his post, that he and me and bla
bla all are same.

Okay , one thing I am eager to know is there any rule that only one
user from a single country can do post here. Too stupid you are really.

If you want to start more talk on this, please do select one of his
post, and  tell the same stupid non sense comment that he and me is
same. and wait for the reply, anyway this way I can be also able to
prove all are different. Nice caught you guys has.

Don't choose the path that STUPID S.D has shown above.

And I am reminding you one more thing not to put such non-sense comment
here in my thread.

Start a new one.
Posted by D. Deryl Downey (ddd)
on 2013-03-02 15:53
(Received via mailing list)
Love U Ruby, aka Kumar R,

Give it up. You must think the entire world is stupid if you think you 
can
get away with posting under multiple aliases and NOT have people point 
it
out so others that aren't in the know don't get caught up on your 
trolling.

You do realize that eventually the list administrators will ban all your
known names and addresses right? I mean, you can't really be THAT stupid
not to realize that.
Posted by Kumar R. (kumar_r)
on 2013-03-02 15:58
D. Deryl Downey wrote in post #1099832:
> Love U Ruby, aka Kumar R,
>
> Give it up. You must think the entire world is stupid if you think you
> can
> get away with posting under multiple aliases and NOT have people point


What I just asked above please do that first. and wait to get reply from 
him/her. Till then no talk please.

If you bad,I can always.

And here I asked one questions which is purely on-topic. So I didn't do 
anything bad. Still you guys horribly insulting me. making compare 
myself with others.


I am really shocked. :(
Posted by Stefan Mahlitz (zaphy)
on 2013-03-02 16:00
Michel wrote in post #1099829:
> The pseudonym "chandan mallik" also come from the same IP address !

ruby-forum.com has 188.40.52.210 so mails sent from ruby-forum will
probably have this IP-address in the header.
Posted by D. Deryl Downey (ddd)
on 2013-03-02 16:05
(Received via mailing list)
Bullshit you're shocked. You're a troll, and exposed troll at that, and
you think everyone is stupid enough to just let you waste OUR time and
effort, and waste this resource for everyone else. You choke email boxes
with stupidity and expect people NOT to take it to you face to face? LOL
you're funny
Posted by Michel (Guest)
on 2013-03-02 16:29
(Received via mailing list)
Le samedi 02 mars 2013 à 23:41 +0900, Michel a écrit :

> Le samedi 02 mars 2013 à 06:57 +0900, S.D a écrit :
>
> > "Kumar R.": "YAATSGFY"
> >
> > FYI: Kumar R. is another psuedonym for Love U Ruby, Arup Rakshit, Xavier R., 
Tukai Patra and possibly others.
> > He has proven to be a troll and a help vampire.
> >
>
>
> The pseudonym "chandan mallik" also come from the same IP address !


And so does the pseudonym "shaji n." !!
Posted by Kumar R. (kumar_r)
on 2013-03-02 16:32
Hey, I am repeatedly saying that not to do this on my thread. But you 
didn't hear me.

Why you are not updating on their posts the same?


Thanks.
Posted by D. Deryl Downey (ddd)
on 2013-03-02 16:44
(Received via mailing list)
Because the 'they' is really 'you', so using this thread or 'their' 
thread
targets the same person. YOU!
Posted by Robert Klemme (robert_k78)
on 2013-03-02 17:12
(Received via mailing list)
On Sat, Mar 2, 2013 at 4:43 PM, D. Deryl Downey <me@daviddwdowney.com> 
wrote:
> Because the 'they' is really 'you', so using this thread or 'their' thread
> targets the same person. YOU!

Folks, please stop it.  I don't know whether there is one or multiple
persons behind these pseudonyms but I do know that you don't get rid
of trolls that way.

Cheers

robert
Posted by Bartosz Dziewoński (matmarex)
on 2013-03-02 17:14
(Received via mailing list)
Deryl, please get a life.
Posted by D. Deryl Downey (ddd)
on 2013-03-02 17:29
(Received via mailing list)
Got one, enjoying it. Moving on.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.