From: Trans Date: 2006-08-11T07:25:10+09:00 Subject: Re: nonce Tim Pease wrote: > > Should we ask Matz to rename the singleton to the "nonce"? We'll, I think it's enough to point out that this term is there. It's a got a classy feel to it, "nonce class", which is nice. So we can all just sort of maul it over and we'll see if it perculates upward. For starters I'm using it when I assign it to var, eg. nonce = (class< How about > a new keyword for referring to the singleton ... > > class << self > ... > end > > becomes > > nonce self do > ... > end Like that. Never really cared for the << notation since it looks like appending to an array or string, etc. > how about > > module Kernel > def nonce( arg, &block ) > n = class << arg; self end > return n.class_eval(&block) if block_given? > n > end > end > > I do like the word, though -- etymology is fun! :-) Definitely. I was quite floored to find an honest ot goodness synonym for singleton. And it's obscure enough so it doesn't have any significant connotation baggage, which is great. T.