nonce

T

Tim Pease


Should we ask Matz to rename the singleton to the "nonce"? How about
a new keyword for referring to the singleton ...

class << self
...
end

becomes

nonce self do
...
end

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!

TwP
 
T

Trans

Tim said:
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<<self;self;end)
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.
 
D

dblack

Hi --

Should we ask Matz to rename the singleton to the "nonce"? How about
a new keyword for referring to the singleton ...

class << self
...
end

becomes

nonce self do
...
end

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!

The problem with it for singleton class is that it is really a time
word. It suggests "for now", whereas a singleton class can be
accessed repeatedly. It's kind of the same problem as "ad hoc", since
if you use a singleton class twice, it's not for one particular
purpose.


David

--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.
 
T

Trans

Hi --



The problem with it for singleton class is that it is really a time
word. It suggests "for now", whereas a singleton class can be
accessed repeatedly. It's kind of the same problem as "ad hoc", since
if you use a singleton class twice, it's not for one particular
purpose.

An occassion need not be limited to an instantaneous moment. Could I
not say, "I have occassion for an Eigenclass"? It also has other
connotations, such as "need".

I don't think any word is ever going to be perfect, precisely becuase
there is no precise word for it. We have to define one. And the problem
with "singleton" is that it's already taken.

T.
 
H

Hal Fulton

Trans said:
An occassion need not be limited to an instantaneous moment. Could I
not say, "I have occassion for an Eigenclass"? It also has other
connotations, such as "need".

I don't think any word is ever going to be perfect, precisely becuase
there is no precise word for it. We have to define one. And the problem
with "singleton" is that it's already taken.

I've never perceived a problem there. "Singleton" is used in different
circumstances, as is "nonce." Much of meaning depends on context.

But "nonce" does carry a strong connotation of "one-time usage."


Hal
 
T

Trans

Hal said:
I've never perceived a problem there. "Singleton" is used in different
circumstances, as is "nonce." Much of meaning depends on context.

But "nonce" does carry a strong connotation of "one-time usage."

Honestly. Have you ever even used the work _nonce_ in your entire life?


Right. So how "strong" can any connotation possibly be? The idea here
is clearly to give it a new connotation --that's the point. With
Singleton, it's not just a connotation but rather a complete
redefinition of an already accepted term in OOP parlance.

T.
 
H

Hal Fulton

Trans said:
Honestly. Have you ever even used the work _nonce_ in your entire life?

I have used it many times over the last twenty years, mostly in
the phrase "for the nonce."


Hal
 
H

Hal Fulton

Hal said:
I have used it many times over the last twenty years, mostly in
the phrase "for the nonce."

Hal

Also in the contexts of cryptography, mathematics, and Lojban.

Hal
 
M

Martin DeMello

I have used it many times over the last twenty years, mostly in
the phrase "for the nonce."

Same here. Also "nonce word". And I agree, it carries the wrong
connotations for the singleton class, whereas "eigenclass" seems to me
to be just about perfect, both in literal meaning and connotations.

martin
 
M

Matt Lawrence

Same here. Also "nonce word". And I agree, it carries the wrong
connotations for the singleton class, whereas "eigenclass" seems to me
to be just about perfect, both in literal meaning and connotations.

Hmmm, I wonder if there would be anything that would qualify as an
eigerclass?

And, yes, I use nonce on occasion. I read a lot of British fiction.

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.
 
T

Trans

Hal said:
Also in the contexts of cryptography, mathematics, and Lojban.

Okay, well I stand corrected then. I have never heard the word used in
common speech before. But it does come up in techincal uses, and since
your so heavily involved, that make sense.

Oh well, so much for nonce. I guess I'm the only person left who cares
the singleton has a different meaning, and in the very same field
(OOP), than Ruby's use.

T.
 
P

Peña, Botp

ZnIgUGF1bA0KIyBodHRwOi8vd3d3LnVyYmFuZGljdGlvbmFyeS5jb20vZGVmaW5lLnBocD90ZXJt
PW5vbmNlDQojIA0KaHR0cDovL3d3dy5mcmVlZGljdGlvbmFyeS5vcmcvaW5kZXgucGhwP1F1ZXJ5
PU5vbmNlJmRhdGFiYXNlPSomc3RyYXRlZ3k9ZXhhY3QNCg==
 
M

Michael Ulm

Trans said:
Honestly. Have you ever even used the work _nonce_ in your entire life?

Aaargh!

Hamlet Act IV, Scene VII

When in your motion you are hot and dry,
As make your bouts more violent to that end,
And that he calls for drink, I'll have prepar'd him
A chalice for the nonce: wheron but sipping
If he by chance escape your venom'd stuck,
Our purpose may hold there.

Best regards,

Michael

--
Michael Ulm
R&D Team
ISIS Information Systems Austria
tel: +43 2236 27551-219, fax: +43 2236 21081
e-mail: (e-mail address removed)
Visit our Website: www.isis-papyrus.com

---------------------------------------------------------------
This e-mail is only intended for the recipient and not legally
binding. Unauthorised use, publication, reproduction or
disclosure of the content of this e-mail is not permitted.
This email has been checked for known viruses, but ISIS accepts
no responsibility for malicious or inappropriate content.
---------------------------------------------------------------
 
A

Austin Ziegler

Honestly. Have you ever even used the work _nonce_ in your entire life?

Yes.

It's actually a relatively common term in cryptographic references,
IIRC. The cryptographic nonce is some (random?) string that is used
once and only once (it doesn't repeat and it isn't typically
predictable) and typically in a challenge/response identification
protocol.

http://computing-dictionary.thefreedictionary.com/Nonce+(cryptography)
http://www.atis.org/tg2k/_nonce.html

IMO, TFD has semi-backronymed nonce here, ignoring that there's an
English word, but TFD tends to do that.
Right. So how "strong" can any connotation possibly be? The idea here
is clearly to give it a new connotation --that's the point. With
Singleton, it's not just a connotation but rather a complete
redefinition of an already accepted term in OOP parlance.

I agree with you that 'nonce' is close to what we want, but it isn't
*quite* meaningful enough on its own.

-austin
 
D

dblack

Hi --

Same here. Also "nonce word". And I agree, it carries the wrong
connotations for the singleton class, whereas "eigenclass" seems to me
to be just about perfect, both in literal meaning and connotations.

My main problem with "eigenclass" is that it's in German, whereas
everything else in Ruby is in English. I actually suggested "own
class" a long time ago. Eigenclass is basically a German translation
of that. I love German -- majored in it in college, even -- but
"eigenclass" just strikes me as a bit joke-like or perhaps a bit
pretentious.

I've refrained from using the term "own class" pre-emptively, though,
which in the "Darwinian" world of bringing about a fait accompli in
the area of renaming singleton classes takes it pretty much out of the
running :)


David

--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top