# Re: Little Things

**URL:** <https://www.ruby-forum.com/t/re-little-things/81212>\
**Category:** Ruby\
**Created:** [January 6, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/re-little-things/81212 "2007-01-06T19:19:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 6, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/re-little-things/81212/1 "2007-01-06T19:19:10Z")

</div>

From: removed\_email\_address@domain.invalid [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]

> xml.freeze{ ‘oops’ }  
> xml.id{ ‘oops’ }  
> xml.method{ ‘oops’ }  
> xml.new{ ‘oops’ }  
> xml.send{ ‘oops’ }  
> xml.taint{ ‘oops’ }  
> xml.type{ ‘oops’ }

Thank you for this; despite following this thread (including reading all  
of Trans’ posts) I had no idea what this ‘keyword’ bit was that he was  
talking about.

My personal opinion:  
DSLs are nice and all, but Ruby the language _also_ needs to be designed  
for…Ruby code. I find the Pervasives concept terrible. If we have  
“Pervasives.send”, and ‘send’ and ‘new’ are in the same boat, then  
consistency would require code like:  
my\_foo = Pervasives.new( Foo, :bar )  
which is insane, in my mind.

You’re basically saying, “Anything that is unique to a class you call as  
a method using dot notation. But the most common methods…stuff that  
glues all objects in the same pool…well, that’s not a method of the  
object anymore.” That’s backwards, IMO.

I don’t like the idea of \_\_method names, either. It’s a pain to type,  
and I find it ugly.

If you want a DSL with method\_missing, make a truly BlankSlate base  
class. Go grab the methods you need and re-bind them under other names  
if you must, for your (fun, awesome) crazy metahackery.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [January 6, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/re-little-things/81212/2 "2007-01-06T19:30:50Z")

</div>

On Fri, 5 Jan 2007, Gavin K. wrote:

> > xml.taint{ ‘oops’ }  
> > consistency would require code like: my\_foo = Pervasives.new( Foo, :bar )  
> > which is insane, in my mind.

two points, after noting that i quite agree with you.

1. there are already a ton of dsl’s written in ruby. all of them have  
small  
unrepairable bugs caused by naming issues.

2. Pervasives.send would ONLY be used when some was doing metahackery,  
designing dsls, a debugger, profiler, memory leak detector, etc. the  
alternatives are:

> You’re basically saying, “Anything that is unique to a class you call as a  
> method using dot notation. But the most common methods…stuff that glues  
> all objects in the same pool…well, that’s not a method of the object  
> anymore.” That’s backwards, IMO.

it is. for a reason: you can use it when you are doing backward things:  
writing code that manages objects (debugger, etc) rather than code that  
is  
managed by objects (normal code). any answer that allows deep reliable  
introspection must reside outside of objects. if not through  
Pervasives, then  
via some other external method - though syntax shortcuts might exist…

> I don’t like the idea of \_\_method names, either. It’s a pain to type,  
> and I find it ugly.

what’s your preferred solution?

> If you want a DSL with method\_missing, make a truly BlankSlate base class.  
> Go grab the methods you need and re-bind them under other names if you must,  
> for your (fun, awesome) crazy metahackery.

you can’t. if i undefine id, object\_id, etc. and they are called: i  
don’t  
know why they were called: metahackery or ‘to the point’? that’s the  
whole  
issue.

regards.

-a
