# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1634

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1635

---

## [Re: What are closures, continuations?](https://www.ruby-forum.com/t/re-what-are-closures-continuations/73917)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/re-what-are-closures-continuations/73917 "2006-10-27T23:04:37Z")

</div>

From: removed\_email\_address@domain.invalid One more question – what are lambdas? :wink: Another name for anonymous functions - functions declared on the fly without assigning them to some method or top-level variabl…

---

## [Re: What are closures, continuations?](https://www.ruby-forum.com/t/re-what-are-closures-continuations/73916)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 11:02pm UTC](https://www.ruby-forum.com/t/re-what-are-closures-continuations/73916 "2006-10-27T23:02:37Z")

</div>

From: Joe R. MUDCRAP-CE Subject: What are closures, continuations? Short answer to closures: Closures are functions that retain access to local variables declared in the same scope as the function. Long answer to …

---

## [No continuations in Ruby2?](https://www.ruby-forum.com/t/no-continuations-in-ruby2/73785)

<div class="topic-metadata">

**Author:** [@philthompson](https://www.ruby-forum.com/u/philthompson)\
**Replies:** 1\
**Last updated:** [October 27, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/no-continuations-in-ruby2/73785 "2006-10-27T21:44:28Z")

</div>

According to this article: http://www.artima.com/forums/flat.jsp?forum=281&thread=180325 …Ruby 2 will not have continuations. Is this true? If so, why would continuations be dropped? It’ll be pretty tough to imple…

---

## [Ruby's garbage collector](https://www.ruby-forum.com/t/rubys-garbage-collector/73365)

<div class="topic-metadata">

**Author:** [@maz](https://www.ruby-forum.com/u/maz)\
**Replies:** 12\
**Last updated:** [October 27, 2006, 9:36pm UTC](https://www.ruby-forum.com/t/rubys-garbage-collector/73365 "2006-10-27T21:36:27Z")

</div>

Is there a name for Ruby’s garbage collecting strategy? I’m on a web forum and the topic of garbage collection came up. There’s a claim that you can never make a “perfect” garbage collector. In other words, there wil…

---

## [Recommendation for a beginner's ruby book/tutorial](https://www.ruby-forum.com/t/recommendation-for-a-beginners-ruby-book-tutorial/73849)

<div class="topic-metadata">

**Author:** [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Replies:** 4\
**Last updated:** [October 27, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/recommendation-for-a-beginners-ruby-book-tutorial/73849 "2006-10-27T21:34:24Z")

</div>

For someone who knows very little programming, what is the best book to get for programming Ruby? She was way too intimidated by the pick axe book. I’m thinking one of these two: Teach yourself ruby in 21 days http…

---

## [Re: can there be a "with" construction?](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73893)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73893 "2006-10-27T20:36:14Z")

</div>

Jacob F. wrote: reinterprets it as system.startup.license, which works. In there a way to bend the language to that it acts like this? Thx - m. it stops execution of the block after redispatching the first exce…

---

## [How to get only the duplicatet items from an array](https://www.ruby-forum.com/t/how-to-get-only-the-duplicatet-items-from-an-array/73883)

<div class="topic-metadata">

**Author:** [@Nico\_L](https://www.ruby-forum.com/u/Nico_L)\
**Replies:** 4\
**Last updated:** [October 27, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/how-to-get-only-the-duplicatet-items-from-an-array/73883 "2006-10-27T20:26:12Z")

</div>

hi all, is there a oneline to get only the duplicatet item from an array? i have an array like this aTemp = \[1, 1, 2, 2, 3, 4\] and i want to know, which items are duplicatet. i thought i can do it like aTemp - aTe…

---

## [Re: can there be a "with" construction?](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73888)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 1\
**Last updated:** [October 27, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73888 "2006-10-27T20:10:12Z")

</div>

matt neuburg wrote: can even chain these tests: with system.temp, system.startup { string(license) } That means we try system.temp.license and if that doesn’t exist we proceed to system.startup.license. So my que…

---

## [Re: Potential Brit ruby meeting formally Chunky Bacon](https://www.ruby-forum.com/t/re-potential-brit-ruby-meeting-formally-chunky-bacon/73855)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 2\
**Last updated:** [October 27, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/re-potential-brit-ruby-meeting-formally-chunky-bacon/73855 "2006-10-27T20:08:11Z")

</div>

Thanks Paul but for now it might be best if I did just sit quietly in the corner like a good little girl. Thank you very much to the people who politely informed me of existing groups I can go along to. I’m glad that …

---

## [Re: can there be a "with" construction?](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73889)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 8:02pm UTC](https://www.ruby-forum.com/t/re-can-there-be-a-with-construction/73889 "2006-10-27T20:02:11Z")

</div>

matt neuburg wrote: with system.startup { string(license) } def with( obj, &block ) obj.instance\_eval( &block ) end It’s not quite the same as ‘with’ in some languages (which combine the specified scope with th…

---

## [Re: classless methods](https://www.ruby-forum.com/t/re-classless-methods/73887)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 7:58pm UTC](https://www.ruby-forum.com/t/re-classless-methods/73887 "2006-10-27T19:58:10Z")

</div>

From: removed\_email\_address@domain.invalid \[mailto:removed\_email\_address@domain.invalid\] On And since Object is an ancestor of pretty much everything in ruby, it’s interesting to note that these methods are now define…

---

## [Re: classless methods](https://www.ruby-forum.com/t/re-classless-methods/73880)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 1\
**Last updated:** [October 27, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/re-classless-methods/73880 "2006-10-27T19:20:05Z")

</div>

From: Nick S. \[mailto:removed\_email\_address@domain.invalid\] Actually, it looks like it becomes a public instance method of Object: \[snip\] irb is messing with your head here. Try the same as a standalone Ruby program…

---

## [To folks who talked to me about Ruport during RubyConf](https://www.ruby-forum.com/t/to-folks-who-talked-to-me-about-ruport-during-rubyconf/73879)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 7:08pm UTC](https://www.ruby-forum.com/t/to-folks-who-talked-to-me-about-ruport-during-rubyconf/73879 "2006-10-27T19:08:04Z")

</div>

We’ve got a great thread going on on Ruport mailing list where people are introducing themselves and providing some great feedback and discussion topics. If you met up with me at RubyConf and mentioned you were intere…

---

## [Getting (var = false) to return true?](https://www.ruby-forum.com/t/getting-var-false-to-return-true/73817)

<div class="topic-metadata">

**Author:** [@joe](https://www.ruby-forum.com/u/joe)\
**Replies:** 7\
**Last updated:** [October 27, 2006, 7:06pm UTC](https://www.ruby-forum.com/t/getting-var-false-to-return-true/73817 "2006-10-27T19:06:04Z")

</div>

In Rails (it’s more of a Ruby question though :wink: ), I have: def before\_update @var = get\_old\_var\_value end and if get\_old\_var\_value returns a false value it causes the update to cancel. Is there some function th…

---

## [Re: Fuzzy Time (#99)](https://www.ruby-forum.com/t/re-fuzzy-time-99/73877)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 6:54pm UTC](https://www.ruby-forum.com/t/re-fuzzy-time-99/73877 "2006-10-27T18:54:03Z")

</div>

From: removed\_email\_address@domain.invalid \[mailto:removed\_email\_address@domain.invalid\] right. i understood that. but this is where i see the contradiction: from the viewpoint of the observer a clock which remain…

---

## [Re: Chunky Bacon](https://www.ruby-forum.com/t/re-chunky-bacon/73729)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 7\
**Last updated:** [October 27, 2006, 6:44pm UTC](https://www.ruby-forum.com/t/re-chunky-bacon/73729 "2006-10-27T18:44:03Z")

</div>

And again, what has any of this got to do with coding! Thanks \_why for this fantastic tangant! Gem

---

## [Re: nil.to\_s != "nil"](https://www.ruby-forum.com/t/re-nil-to-s-nil/73872)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/re-nil-to-s-nil/73872 "2006-10-27T18:40:02Z")

</div>

From: Eero S. \[mailto:removed\_email\_address@domain.invalid\] true.to\_s # =\> “true” false.to\_s # =\> “false” nil.to\_s # =\> “” “” is not a valid representation of nil. “nil” is. How do you define “valid”? obj == e…

---

## [Why is my singleton method called before the class is initia](https://www.ruby-forum.com/t/why-is-my-singleton-method-called-before-the-class-is-initia/73798)

<div class="topic-metadata">

**Author:** [@greenbox](https://www.ruby-forum.com/u/greenbox)\
**Replies:** 11\
**Last updated:** [October 27, 2006, 6:40pm UTC](https://www.ruby-forum.com/t/why-is-my-singleton-method-called-before-the-class-is-initia/73798 "2006-10-27T18:40:02Z")

</div>

Consider: class BigGuy def initialize @favorites = \[“a”,“b”,“c”\] end class \<\< self def display\_favs class\_eval “p @favorites” end end end class LittleGuy \< BigGuy display\_favs end Why does this display “nil…

---

## [Re: Fuzzy Time (#99)](https://www.ruby-forum.com/t/re-fuzzy-time-99/73865)

<div class="topic-metadata">

**Author:** [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Replies:** 1\
**Last updated:** [October 27, 2006, 6:34pm UTC](https://www.ruby-forum.com/t/re-fuzzy-time-99/73865 "2006-10-27T18:34:01Z")

</div>

From: removed\_email\_address@domain.invalid \[mailto:removed\_email\_address@domain.invalid\] Requirement #2: The time shown by the clock must randomly vary +/- 5 minutes from reality. For example, if the time is actuall…

---

## [Singleton Methods](https://www.ruby-forum.com/t/singleton-methods/73811)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 5\
**Last updated:** [October 27, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/singleton-methods/73811 "2006-10-27T18:21:59Z")

</div>

What is the purpose of singleton method? Why is singleton method defined on individual object instead of a class? TIA

---

## [Test::Unit need help with assert](https://www.ruby-forum.com/t/test-unit-need-help-with-assert/73772)

<div class="topic-metadata">

**Author:** [@quicksort](https://www.ruby-forum.com/u/quicksort)\
**Replies:** 4\
**Last updated:** [October 27, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/test-unit-need-help-with-assert/73772 "2006-10-27T18:17:43Z")

</div>

Hi, I’m new to Ruby but have has some success bending it to my will. I am using the Test::Unit framework but it doesn’t quite fit my needs. I need to report the number of asserts() that pass and the number that fail. …

---

## [UTF-8 problems](https://www.ruby-forum.com/t/utf-8-problems/73717)

<div class="topic-metadata">

**Author:** [@capeboylego](https://www.ruby-forum.com/u/capeboylego)\
**Replies:** 5\
**Last updated:** [October 27, 2006, 6:13pm UTC](https://www.ruby-forum.com/t/utf-8-problems/73717 "2006-10-27T18:13:58Z")

</div>

Hi, I (perhaps stupidly) decided to compile and install 1.8.5 on my Mac, thinking there might have been some improvements to Ruby. So, I did, and I fiddled around with settings, changing the default encoding to UTF-8 …

---

## [The Future of RCRrchive (was Re: 1.9 Backport?)](https://www.ruby-forum.com/t/the-future-of-rcrrchive-was-re-1-9-backport/73707)

<div class="topic-metadata">

**Author:** [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Replies:** 3\
**Last updated:** [October 27, 2006, 5:29pm UTC](https://www.ruby-forum.com/t/the-future-of-rcrrchive-was-re-1-9-backport/73707 "2006-10-27T17:29:52Z")

</div>

Trans wrote: Reading: RubyConf 2006 Recap Also, is it true RCRchive is to be no more? No. RCRchive is to be remade. Most RCRs will be tossed because new RCRs are required to explain the WHY behind the proposed …

---

## [Re: a regex](https://www.ruby-forum.com/t/re-a-regex/73854)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 4:35pm UTC](https://www.ruby-forum.com/t/re-a-regex/73854 "2006-10-27T16:35:44Z")

</div>

What exactly do you want from the regex? Do you want to split the string into 3 variables? i.e. string = 2006%2F10%2Fasdfasdf year = 2006 day = 10 text = asdfasdf Or are you wanting to find a regex that would match…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/102567)

<div class="topic-metadata">

**Author:** [@dirk](https://www.ruby-forum.com/u/dirk)\
**Replies:** 4\
**Last updated:** [October 27, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/no-subject/102567 "2006-10-27T16:33:44Z")

</div>

unsubscribe

---

## [Reading variables in a file](https://www.ruby-forum.com/t/reading-variables-in-a-file/73845)

<div class="topic-metadata">

**Author:** [@ogrecio](https://www.ruby-forum.com/u/ogrecio)\
**Replies:** 5\
**Last updated:** [October 27, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/reading-variables-in-a-file/73845 "2006-10-27T16:27:44Z")

</div>

I’m thinking of migrating from Fortran to Ruby. Do you think i should go ahead?? First problem i have. How to read a file with several fields? This means: Imagine a file: Peter4 1990 Sam 3 1980 Grac6 1991 I would…

---

## [Simple math question](https://www.ruby-forum.com/t/simple-math-question/73660)

<div class="topic-metadata">

**Author:** [@brad7a0](https://www.ruby-forum.com/u/brad7a0)\
**Replies:** 26\
**Last updated:** [October 27, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/simple-math-question/73660 "2006-10-27T16:19:43Z")

</div>

What’s the quickest way to determine if an int is an even number 2,4,6,8… Anything such as int.even or int.odd returning true/false? I want to test the length of an array and add one element to it if it has an odd nu…

---

## [Re: Recommendation for a beginner's ruby book/tutorial](https://www.ruby-forum.com/t/re-recommendation-for-a-beginners-ruby-book-tutorial/73850)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 4:05pm UTC](https://www.ruby-forum.com/t/re-recommendation-for-a-beginners-ruby-book-tutorial/73850 "2006-10-27T16:05:42Z")

</div>

I would say the best online book to go for is “The Little Book of Ruby” and it’s free. ( : Just to get you going. Then invest in Pickaxe (Pragmatic Programmer’s, “Programming Ruby”) http://www.sapphiresteel.com/ Gem

---

## [Re: a regex](https://www.ruby-forum.com/t/re-a-regex/73847)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 0\
**Last updated:** [October 27, 2006, 3:33pm UTC](https://www.ruby-forum.com/t/re-a-regex/73847 "2006-10-27T15:33:38Z")

</div>

You can split it: string = 2006%2F10%2Fasdfasdf year, day, text = string.split(/%2F/) Should give: year=2006 day=10 text=asdfasdf The variables at the beginning are the names you give the different bits you want …

---

## [Re: Potential Brit ruby meeting formally Chunky Bacon](https://www.ruby-forum.com/t/re-potential-brit-ruby-meeting-formally-chunky-bacon/73730)

<div class="topic-metadata">

**Author:** [@CameronS\_Gemma\_SUK](https://www.ruby-forum.com/u/CameronS_Gemma_SUK)\
**Replies:** 5\
**Last updated:** [October 27, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/re-potential-brit-ruby-meeting-formally-chunky-bacon/73730 "2006-10-27T14:55:34Z")

</div>

Similar situation for most of the brits going to Denver! I’ll organise something if people want to meet up, but it seems there’s already so much going on that it’s not necessary? Again I am indeed a ruby n00by and eve…

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1633)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1635)
