Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > What kind of scoping does Ruby use?Static or Dynamic

Reply
Thread Tools

What kind of scoping does Ruby use?Static or Dynamic

 
 
Noyan Aydin
Guest
Posts: n/a
 
      12-18-2006
What kind of scoping ruby use, even if it has lots of scoping rules
which was supported by adding different parameters infront of variable
names and using different character size. We do not decide what kind of
scoping does Ruby use? Dynamic or static scoping. Thank you in advance.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      12-18-2006
On 18.12.2006 16:56, Noyan Aydin wrote:
> What kind of scoping ruby use, even if it has lots of scoping rules
> which was supported by adding different parameters infront of variable
> names and using different character size. We do not decide what kind of
> scoping does Ruby use? Dynamic or static scoping. Thank you in advance.


Static.

robert
 
Reply With Quote
 
 
 
 
Ken Bloom
Guest
Posts: n/a
 
      12-18-2006
On Tue, 19 Dec 2006 00:56:02 +0900, Noyan Aydin wrote:

> What kind of scoping ruby use, even if it has lots of scoping rules
> which was supported by adding different parameters infront of variable
> names and using different character size. We do not decide what kind of
> scoping does Ruby use? Dynamic or static scoping. Thank you in advance.
>


Ruby uses static scoping in the basic syntax, however the use of eval with
a binding, or instance_eval (even when hidden very deep in other
methods) can change the context in which a block or string of code is
evaluated, causing it to have different scoping from the surrounding code
(but still static).

--Ken Bloom

--
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 04-15-2011 04:00 AM
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 01-06-2011 05:00 PM
Noob Q: ruby block scoping question (ruby TK) Philip Amadeo Saeli Ruby 4 05-01-2008 07:43 PM
Dynamic or static scoping in C++ and Smalltalk SPECTACULAR C++ 3 01-01-2007 12:04 PM
Dynamic Scoping problem Daniel Lemos Itaborai Python 2 08-23-2004 05:57 PM



Advertisments