# Nano & mega

**URL:** <https://rubytalk.org/t/nano-mega/20535>\
**Category:** ruby-talk\
**Created:** [31 August 2005 21:33 UTC](https://rubytalk.org/t/nano-mega/20535 "2005-08-31T21:33:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [31 August 2005 21:33 UTC](https://rubytalk.org/t/nano-mega/20535/1 "2005-08-31T21:33:37Z")

</div>

What's up with the funky names ... AND, is there an easy way to just require  
all of them ?  
I'd like to have all of nano and all of mega easily includable without 400  
separate require statements ( exagerated I know, but still )  
j.

> **···**
>
> --  
> "So long, and thanks for all the fish"
> 
> Jeff Wood

---

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [1 September 2005 01:21 UTC](https://rubytalk.org/t/nano-mega/20535/2 "2005-09-01T01:21:25Z")

</div>

Hi Jeff,

The nice thing about Nano is that you can require just the extension  
methods you need, no more, no less. I realize at first that seems  
unecessarily burdensome, but in practice it actually proves be quite  
natural. And I highly recommend you try to use the library in this  
manner. Nonetheless, there is indeed a way to include a many a method  
at once.

&nbsp;&nbsp;require 'nano/full'

But be forewarned, this is still experimental. The reason is that not  
all of the methods in Nano "play nice" --some have very specific uses.  
What I have done is make a list of these particular methods and  
"subtract" them from the totality and this is what is in nano/full.rb.  
But those lists are not complete/perfected yet, so don't be suprised if  
something odd occurs when using 'full'. (And please let me know if you  
run across something so I can adjust the lists!) To get more info on  
what exactly these methods are try this:

&nbsp;&nbsp;require 'nanosys'

&nbsp;&nbsp;# list of method files in full  
&nbsp;&nbsp;NanoSystem.full

&nbsp;&nbsp;# list of methods considered unsafe and not in full  
&nbsp;&nbsp;NanoSystem.unsafe

&nbsp;&nbsp;# other methods not in full as a cautionary measure  
&nbsp;&nbsp;NanoSystem.noauto

To learn more I recommend the README doc which is included in the  
package and is also the front page of the API RDocs on the website  
([http://nano.rubyforge.org](http://nano.rubyforge.org))

As for Mega, again it is not the standard usage, but you can do:

&nbsp;&nbsp;require 'mega'  
&nbsp;&nbsp;autoload\_classes

Now whenever you reference a Mega Module it will be automatically  
required (w/ a few exceptions.) As of yet I haven't thought of creating  
a require file that loads all of them, but I suppose I can. Thanks for  
the suggestion.

T.

---

<div class="post-metadata">

**Author:** ![Gavin\_Kistner2](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@Gavin\_Kistner2](https://rubytalk.org/u/Gavin_Kistner2)\
**Post date:** [1 September 2005 01:23 UTC](https://rubytalk.org/t/nano-mega/20535/3 "2005-09-01T01:23:06Z")

</div>

2 minutes looking at the library hierarchy shows:

require 'nano' #Same as require 'nano/base', a common set of functionality  
require 'nano/array' #All the array items  
require 'nano/full' #Everything

> **···**
>
> On Aug 31, 2005, at 3:33 PM, Jeff Wood wrote:
> 
> > [snip] AND, is there an easy way to just require all of them ?  
> > I'd like to have all of nano and all of mega easily includable without 400  
> > separate require statements ( exagerated I know, but still )

---

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [1 September 2005 01:56 UTC](https://rubytalk.org/t/nano-mega/20535/4 "2005-09-01T01:56:24Z")

</div>

Jeff Wood wrote:

> What's up with the funky names ...

Since Ruby methods can have/be punctuation marks, it is necessary to  
encode them in order to be compatible with all file systems. I have  
used URI escaping so:

&nbsp;&nbsp;: -\> %3A  
&nbsp;&nbsp;? -\> %3F  
&nbsp;&nbsp;! -\> %21  
&nbsp;&nbsp;= -\> %3D

etc.

---

<div class="post-metadata">

**Author:** ![Dave\_Burt2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/dave_burt2/32/2036_2.png) [@Dave\_Burt2](https://rubytalk.org/u/Dave_Burt2)\
**Post date:** [1 September 2005 01:56 UTC](https://rubytalk.org/t/nano-mega/20535/5 "2005-09-01T01:56:24Z")

</div>

Jeff Wood wrote...

> What's up with the funky names ... AND, is there an easy way to just  
> require  
> all of them ?  
> I'd like to have all of nano and all of mega easily includable without  
> 400  
> separate require statements ( exagerated I know, but still )

In the API docs at nano.rubyforge.org and mega.rubyforge.org, check out the  
documentation for the \_files\_ nano.rb, nano/base.rb (and mega's  
corresponding files) to see the list of what's included there.

For example, if you just do:  
&nbsp;&nbsp;require 'nano'  
or:  
&nbsp;&nbsp;require 'nano/base'  
you will get all of these for free:  
&nbsp;&nbsp;a.. nano/kernel/require\_nano  
&nbsp;&nbsp;b.. nano/array/to\_h  
&nbsp;&nbsp;c.. nano/binding/eval  
&nbsp;&nbsp;d.. nano/binding/self  
&nbsp;&nbsp;e.. nano/binding/caller  
&nbsp;&nbsp;f.. nano/comparable/cmp  
&nbsp;&nbsp;g.. nano/enumerable/collect\_with\_counter  
&nbsp;&nbsp;h.. nano/enumerable/each\_slice  
&nbsp;&nbsp;i.. nano/float/round\_off  
&nbsp;&nbsp;j.. nano/float/round\_to  
&nbsp;&nbsp;k.. nano/float/round\_at  
&nbsp;&nbsp;l.. nano/hash/slice  
&nbsp;&nbsp;m.. nano/hash/to\_h  
&nbsp;&nbsp;n.. nano/kernel/fn  
&nbsp;&nbsp;o.. nano/kernel/called  
&nbsp;&nbsp;p.. nano/kernel/here  
&nbsp;&nbsp;q.. nano/matchdata/match  
&nbsp;&nbsp;r.. nano/module/basename  
&nbsp;&nbsp;s.. nano/nilclass/to\_f  
&nbsp;&nbsp;t.. nano/nilclass/to\_h  
&nbsp;&nbsp;u.. nano/object/metaclass  
&nbsp;&nbsp;v.. nano/proc/to\_method  
&nbsp;&nbsp;w.. nano/range/to\_r  
&nbsp;&nbsp;x.. nano/regexp/to\_re  
&nbsp;&nbsp;y.. nano/string/blank%3F  
&nbsp;&nbsp;z.. nano/string/cmp  
&nbsp;&nbsp;aa.. nano/string/to\_re  
&nbsp;&nbsp;ab.. nano/symbol/not  
&nbsp;&nbsp;ac.. nano/time/to\_time  
Then there's the require\_\* methods, require\_all in particular.

Happy requiring!  
Dave

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [1 September 2005 05:22 UTC](https://rubytalk.org/t/nano-mega/20535/6 "2005-09-01T05:22:53Z")

</div>

Dave Burt wrote:

> Jeff Wood wrote...
> 
> > What's up with the funky names ... AND, is there an easy way to just require  
> > all of them ?  
> > I'd like to have all of nano and all of mega easily includable without 400  
> > separate require statements ( exagerated I know, but still )  
> > &nbsp;&nbsp;&nbsp;  
> > In the API docs at nano.rubyforge.org and mega.rubyforge.org, check out the documentation for the \_files\_ nano.rb, nano/base.rb (and mega's corresponding files) to see the list of what's included there.
> 
> For example, if you just do:  
> require 'nano'  
> or:  
> require 'nano/base'  
> you will get all of these for free:  
> a.. nano/kernel/require\_nano  
> b.. nano/array/to\_h  
> c.. nano/binding/eval  
> d.. nano/binding/self  
> e.. nano/binding/caller  
> f.. nano/comparable/cmp  
> g.. nano/enumerable/collect\_with\_counter  
> h.. nano/enumerable/each\_slice  
> i.. nano/float/round\_off  
> j.. nano/float/round\_to  
> k.. nano/float/round\_at  
> l.. nano/hash/slice  
> m.. nano/hash/to\_h  
> n.. nano/kernel/fn  
> o.. nano/kernel/called  
> p.. nano/kernel/here  
> q.. nano/matchdata/match  
> r.. nano/module/basename  
> s.. nano/nilclass/to\_f  
> t.. nano/nilclass/to\_h  
> u.. nano/object/metaclass  
> v.. nano/proc/to\_method  
> w.. nano/range/to\_r  
> x.. nano/regexp/to\_re  
> y.. nano/string/blank%3F  
> z.. nano/string/cmp  
> aa.. nano/string/to\_re  
> ab.. nano/symbol/not  
> ac.. nano/time/to\_time  
> Then there's the require\_\* methods, require\_all in particular.
> 
> Happy requiring!  
> Dave

Yeah, about 10 seconds after I sent the mail I found that part of the docs ... Felt like a real goon. Anyways, thanks for putting the information into the docs, and for shooting me a note.

j.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [1 September 2005 05:29 UTC](https://rubytalk.org/t/nano-mega/20535/7 "2005-09-01T05:29:36Z")

</div>

Trans wrote:

> Jeff Wood wrote:
> 
> > What's up with the funky names ...  
> > &nbsp;&nbsp;&nbsp;  
> > Since Ruby methods can have/be punctuation marks, it is necessary to  
> > encode them in order to be compatible with all file systems. I have  
> > used URI escaping so:
> 
> : -\> %3A  
> ? -\> %3F  
> ! -\> %21  
> = -\> %3D
> 
> etc.

Wow, I'd say that the punctionation ( with conversion or not ) should come out of the filenames... the %3A stuff is about as un-user-friendly as anything I've ever seen.

j.

---

<div class="post-metadata">

**Author:** ![Dave\_Burt2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/dave_burt2/32/2036_2.png) [@Dave\_Burt2](https://rubytalk.org/u/Dave_Burt2)\
**Post date:** [1 September 2005 05:46 UTC](https://rubytalk.org/t/nano-mega/20535/8 "2005-09-01T05:46:24Z")

</div>

Jeff Wood wrote:

> Wow, I'd say that the punctionation ( with conversion or not ) should  
> come out of the filenames... the %3A stuff is about as un-user-friendly  
> as anything I've ever seen.

You'd have to have a better alternative, and I can't think of one.  
Consistent naming's important, and I'd rather not be using interesting  
suffixes like "nano/array/rotate\_bang".

To ease the pain, instead of:  
&nbsp;&nbsp;require 'nano/array/rotate%21'  
nano provides:  
&nbsp;&nbsp;require 'nanoreq' # or nanosys or nano or nano/base  
&nbsp;&nbsp;require\_nano 'array/rotate!'  
and I presume mega has an analog.

Cheers,  
Dave

---

<div class="post-metadata">

**Author:** ![Florian\_Gross2](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@Florian\_Gross2](https://rubytalk.org/u/Florian_Gross2)\
**Post date:** [1 September 2005 13:59 UTC](https://rubytalk.org/t/nano-mega/20535/9 "2005-09-01T13:59:45Z")

</div>

Dave Burt wrote:

> You'd have to have a better alternative, and I can't think of one. Consistent naming's important, and I'd rather not be using interesting suffixes like "nano/array/rotate\_bang".

Why not? I think I would prefer this over uri escaping. It's also the convention Ruby uses for the C method names.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [1 September 2005 14:10 UTC](https://rubytalk.org/t/nano-mega/20535/10 "2005-09-01T14:10:16Z")

</div>

Dave Burt wrote:

> Jeff Wood wrote:
> 
> > Wow, I'd say that the punctionation ( with conversion or not ) should  
> > come out of the filenames... the %3A stuff is about as un-user-friendly  
> > as anything I've ever seen.  
> > &nbsp;&nbsp;&nbsp;  
> > You'd have to have a better alternative, and I can't think of one. Consistent naming's important, and I'd rather not be using interesting suffixes like "nano/array/rotate\_bang".
> 
> To ease the pain, instead of:  
> require 'nano/array/rotate%21'  
> nano provides:  
> require 'nanoreq' # or nanosys or nano or nano/base  
> require\_nano 'array/rotate!'  
> and I presume mega has an analog.
> 
> Cheers,  
> Dave

well, there are many alternatives.. I'd just have require 'nano/array' or if you still want the one-by-one functionality ... require 'nano/array/rotate'

ymmv.

j.

---

<div class="post-metadata">

**Author:** ![James\_Edward\_Gray\_II](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@James\_Edward\_Gray\_II](https://rubytalk.org/u/James_Edward_Gray_II)\
**Post date:** [1 September 2005 14:11 UTC](https://rubytalk.org/t/nano-mega/20535/11 "2005-09-01T14:11:07Z")

</div>

Yeah, I have to agree here. I can translate ! to \_bang a lot easier than I can think up what the URI escape code is.

James Edward Gray II

> **···**
>
> On Sep 1, 2005, at 8:59 AM, Florian Groß wrote:
> 
> > Dave Burt wrote:
> > 
> > > You'd have to have a better alternative, and I can't think of one. Consistent naming's important, and I'd rather not be using interesting suffixes like "nano/array/rotate\_bang".
> > 
> > Why not? I think I would prefer this over uri escaping. It's also the convention Ruby uses for the C method names.

---

<div class="post-metadata">

**Author:** ![Brian\_Schroder1](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@Brian\_Schroder1](https://rubytalk.org/u/Brian_Schroder1)\
**Post date:** [1 September 2005 14:18 UTC](https://rubytalk.org/t/nano-mega/20535/12 "2005-09-01T14:18:11Z")

</div>

It thought nano tweaks include to do the conversion behind the scenes.  
Such that you can do

require 'file/exists?'

and require first escapes the ? and then calls the old require.

But I have not used this libs so far.

regards,

Brian

> **···**
>
> On 01/09/05, James Edward Gray II \<james@grayproductions.net\> wrote:
> 
> > On Sep 1, 2005, at 8:59 AM, Florian Groß wrote:
> > 
> > \> Dave Burt wrote:  
> > \>  
> > \>  
> > \>\> You'd have to have a better alternative, and I can't think of one.  
> > \>\> Consistent naming's important, and I'd rather not be using  
> > \>\> interesting suffixes like "nano/array/rotate\_bang".  
> > \>\>  
> > \>  
> > \> Why not? I think I would prefer this over uri escaping. It's also  
> > \> the convention Ruby uses for the C method names.
> > 
> > Yeah, I have to agree here. I can translate ! to \_bang a lot easier  
> > than I can think up what the URI escape code is.
> > 
> > James Edward Gray II
> 
> --  
> [http://ruby.brian-schroeder.de/](http://ruby.brian-schroeder.de/)
> 
> Stringed instrument chords: [http://chordlist.brian-schroeder.de/](http://chordlist.brian-schroeder.de/)

---

<div class="post-metadata">

**Author:** ![Gavin\_Kistner2](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@Gavin\_Kistner2](https://rubytalk.org/u/Gavin_Kistner2)\
**Post date:** [1 September 2005 14:25 UTC](https://rubytalk.org/t/nano-mega/20535/13 "2005-09-01T14:25:46Z")

</div>

Bang is pretty easy. What are suggestions for #= or #foo versus #foo= ?

> **···**
>
> On Sep 1, 2005, at 8:11 AM, James Edward Gray II wrote:
> 
> > Yeah, I have to agree here. I can translate ! to \_bang a lot easier than I can think up what the URI escape code is.

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [1 September 2005 14:30 UTC](https://rubytalk.org/t/nano-mega/20535/14 "2005-09-01T14:30:07Z")

</div>

Gavin Kistner wrote:

> **···**
>
> > On Sep 1, 2005, at 8:11 AM, James Edward Gray II wrote:
> > 
> > > Yeah, I have to agree here. I can translate ! to \_bang a lot easier than I can think up what the URI escape code is.
> > 
> > Bang is pretty easy. What are suggestions for #= or #foo versus #foo= ?
> 
> This is what I mean ... why not just package them all based on the class they use ?
> 
> Or maybe extend require to actually allow you to be selective about what you require from a file .... like a require 'blah=' from 'nano/array' ???
> 
> j.

---

<div class="post-metadata">

**Author:** ![James\_Edward\_Gray\_II](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@James\_Edward\_Gray\_II](https://rubytalk.org/u/James_Edward_Gray_II)\
**Post date:** [1 September 2005 14:35 UTC](https://rubytalk.org/t/nano-mega/20535/15 "2005-09-01T14:35:00Z")

</div>

> > Yeah, I have to agree here. I can translate ! to \_bang a lot easier than I can think up what the URI escape code is.
> 
> Bang is pretty easy.

You're probably right.

> What are suggestions for #=

Good example. That's a tough one. My best thought:

indexed\_equals

> or #foo versus #foo= ?

This one seems obvious to me:

foo  
foo\_equals

To be perfectly honest though, I haven't even downloaded the library in question, so I have literally no say here. I was just agreeing that I code remember a word better than a code.

I'll go back to minding my own business now. 😉

James Edward Gray II

> **···**
>
> On Sep 1, 2005, at 9:25 AM, Gavin Kistner wrote:
> 
> > On Sep 1, 2005, at 8:11 AM, James Edward Gray II wrote:

---

<div class="post-metadata">

**Author:** ![David\_A\_Black3](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@David\_A\_Black3](https://rubytalk.org/u/David_A_Black3)\
**Post date:** [1 September 2005 16:19 UTC](https://rubytalk.org/t/nano-mega/20535/16 "2005-09-01T16:19:09Z")

</div>

Hi --

> **···**
>
> On Thu, 1 Sep 2005, Gavin Kistner wrote:
> 
> > On Sep 1, 2005, at 8:11 AM, James Edward Gray II wrote:
> > 
> > > Yeah, I have to agree here. I can translate ! to \_bang a lot easier than I can think up what the URI escape code is.
> > 
> > Bang is pretty easy. What are suggestions for #= or #foo versus #foo= ?
> 
> Maybe set\_at and foo\_set or something like that...?
> 
> David
> 
> --  
> David A. Black  
> dblack@wobblini.net

---

<div class="post-metadata">

**Author:** ![Mauricio\_Fernandez](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mauricio\_Fernandez](https://rubytalk.org/u/Mauricio_Fernandez)\
**Post date:** [1 September 2005 14:57 UTC](https://rubytalk.org/t/nano-mega/20535/17 "2005-09-01T14:57:52Z")

</div>

$ grep "rb\_define\_.\*\[\]" ~/src/ruby/ruby.head/array.c  
&nbsp;&nbsp;&nbsp;&nbsp;rb\_define\_singleton\_method(rb\_cArray, "", rb\_ary\_s\_create, -1);  
&nbsp;&nbsp;&nbsp;&nbsp;rb\_define\_method(rb\_cArray, "", rb\_ary\_aref, -1);  
&nbsp;&nbsp;&nbsp;&nbsp;rb\_define\_method(rb\_cArray, "=", rb\_ary\_aset, -1);

> **···**
>
> On Thu, Sep 01, 2005 at 11:35:00PM +0900, James Edward Gray II wrote:
> 
> > \>What are suggestions for #=
> > 
> > Good example. That's a tough one. My best thought:
> > 
> > indexed\_equals
> 
> --  
> Mauricio Fernandez

---

<div class="post-metadata">

**Author:** ![7rans](https://avatars.discourse-cdn.com/v4/letter/7/a8b319/32.png) [@7rans](https://rubytalk.org/u/7rans)\
**Post date:** [2 September 2005 00:31 UTC](https://rubytalk.org/t/nano-mega/20535/18 "2005-09-02T00:31:25Z")

</div>

While \_bang and \_equals might be easy to remember, how easy will it be  
to remember the many others if they all have some made up name?

&nbsp;&nbsp;array/[]= -\> array/aset  
&nbsp;&nbsp;hash/[]= -\> hahs/hset  
&nbsp;&nbsp;proc/\* -\> proc/compose\_op  
&nbsp;&nbsp;enumerable/\*\* -\> enumerable/cross\_op  
&nbsp;&nbsp;...

So if you think remebering a handful or two URI escape codes is hard,  
think how much harder it would be to remember dozens and dozens of  
semi-inconsistent names and the punctuation they correspond-to. I do  
not say this w/o inexperience either, since the last version of Facets  
actually did just that. It wasn't nice. The escapes look weird but they  
quickly become old hat, and are easy enough to look up:

&nbsp;&nbsp;ruby -ruri -e'p URI.escape( "!", "!" )'

But also, you do not need to bother with them at all. There are a  
couple of options for forgetting about the whole thing. The simplest  
is:

&nbsp;&nbsp;require 'nanosys'

Then you can use the actual punctuation all you want --and w/o any  
special require method:

&nbsp;&nbsp;require 'nano/array/[]='

T.

---

<div class="post-metadata">

**Author:** ![Florian\_Gross2](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@Florian\_Gross2](https://rubytalk.org/u/Florian_Gross2)\
**Post date:** [2 September 2005 16:05 UTC](https://rubytalk.org/t/nano-mega/20535/19 "2005-09-02T16:05:38Z")

</div>

Trans wrote:

> But also, you do not need to bother with them at all. There are a  
> couple of options for forgetting about the whole thing. The simplest  
> is:
> 
> &nbsp;&nbsp;require 'nanosys'
> 
> Then you can use the actual punctuation all you want --and w/o any  
> special require method:
> 
> &nbsp;&nbsp;require 'nano/array/='

But I'd rather see this based on meaningful, easy to understand naming scheme under the hood.

Luckily, I have already mapped the special method names. Let me use the look up table from extract.rb:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+" =\> "op\_plus",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"-" =\> "op\_minus",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+@" =\> "op\_plus\_self",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"-@" =\> "op\_minus\_self",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\*" =\> "op\_mul",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\*\*" =\> "op\_pow",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/" =\> "op\_div",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%" =\> "op\_mod",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<\<" =\> "op\_lshift",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\>\>" =\> "op\_rshift",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"~" =\> "op\_tilde",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<=\>" =\> "op\_cmp",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<" =\> "op\_lt",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\>" =\> "op\_gt",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"==" =\> "op\_equal",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<=" =\> "op\_lt\_eq",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\>=" =\> "op\_gt\_eq",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"===" =\> "op\_case\_eq",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"=~" =\> "op\_apply",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"|" =\> "op\_or",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&" =\> "op\_and",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"^" =\> "op\_xor",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"" =\> "op\_fetch",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"=" =\> "op\_store"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

I'd suggest using foo\_bang for foo!, foo\_p for foo? and foo\_setter for foo=.

---

<div class="post-metadata">

**Author:** ![Dave\_Burt2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/dave_burt2/32/2036_2.png) [@Dave\_Burt2](https://rubytalk.org/u/Dave_Burt2)\
**Post date:** [3 September 2005 03:56 UTC](https://rubytalk.org/t/nano-mega/20535/20 "2005-09-03T03:56:26Z")

</div>

Florian Groß:

> Luckily, I have already mapped the special method names. Let me use the  
> look up table from extract.rb:  
> \<snip\>

Yes, nice. I was disagreeing until I saw this list, now I figure the task of  
actually coming up with the names was the barrier.

> I'd suggest using foo\_bang for foo!, foo\_p for foo? and foo\_setter for  
> foo=.

Why foo\_p? What's the p? ZenSpider's ZenTest suggests foo\_eh. I could see  
maybe \_q or \_bool. Also I'd prefer \_set to \_setter.

It's not a big thing, but it means filenames that are more human-legible, if  
a little less machine-readable.

Cheers,  
Dave

[Next page](https://rubytalk.org/t/nano-mega/20535.md?page=2)
