# Scope Vs Extent

**URL:** <https://www.ruby-forum.com/t/scope-vs-extent/143943>\
**Category:** Ruby\
**Created:** [July 24, 2008, 1:41am UTC](https://www.ruby-forum.com/t/scope-vs-extent/143943 "2008-07-24T01:41:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 24, 2008, 1:41am UTC](https://www.ruby-forum.com/t/scope-vs-extent/143943/1 "2008-07-24T01:41:04Z")

</div>

Wikipedia definition:

The scope of a variable describes where in a program’s text, the  
variable may be used, while the extent (or lifetime) describes when in  
a program’s execution a variable has a value. The scope of a variable  
is actually a property of the name of the variable, and the extent is  
a property of the variable itself.

Are they defined the same way in Ruby? TIA.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 24, 2008, 5:50am UTC](https://www.ruby-forum.com/t/scope-vs-extent/143943/2 "2008-07-24T05:50:11Z")

</div>

On Jul 23, 2008, at 5:34 PM, removed\_email\_address@domain.invalid wrote:

> Wikipedia definition:
> 
> The scope of a variable describes where in a program’s text, the  
> variable may be used, while the extent (or lifetime) describes when in  
> a program’s execution a variable has a value. The scope of a variable  
> is actually a property of the name of the variable, and the extent is  
> a property of the variable itself.
> 
> Are they defined the same way in Ruby? TIA.

extent = scope

lexical scope = scope

in ‘normal’ ruby parlance.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)
