[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] pervasives-0.0.1

Ara.T.Howard

1/5/2007 9:49:00 PM

6 Answers

Trans

1/5/2007 11:30:00 PM

0


ara.t.howard@noaa.gov wrote:
> NAME
>
> pervasives.rb
>
> SYNOPSIS
>
> access to pristine object state. if you don't metaprogram you probably
> don't need it
[snip]
> enjoy and send in yer comments/patches!

well, of course i think it's great that you took the time to do this.
but i'm afraid i have an unfortunate little story to tell you.

you see about a year ago i was working on my BasicObject implementation
and how to deal with this exact problem. if you recall i brought up
this very thing on ruby-talk. i had implemented my own version of
Pervasives -- i beleive it was call Meta and/or Inspect at first, but i
later realized the methods fit well in ObjectSpace. tied to this I
created a shortcut to these mthod via a proxy like yours but rather
than '__(obj).foo', mine was 'obj.__.foo.'. Hey, great mind think
alike! :-)

now the tragic ending... with my new lib in hand i went about reworking
my meta code with it. well, it wasnt too long after that i realized it
sucked. my meta-code become bloated, harder to read and slower -- it
just wasn't worth it. and so i gave up on it.

so that' my little story and i fear the same will happen for you. i
think if the issue is going to be truly addressed, we need to work on
something more fundamental. btw eventually i just settled on using
object_class and object_send aliases when need be (shadow methods
__class__, __send__, etc. just got on my nerves) and lived with the
over-ride imperfections.

T.


Trans

1/6/2007 7:14:00 AM

0


ara.t.howard@noaa.gov wrote:

> enjoy and send in yer comments/patches!

_ = Pervasives

_.send(obj, message)

T.


Gregory Brown

1/6/2007 7:27:00 AM

0

On 1/6/07, Trans <transfire@gmail.com> wrote:
>
> ara.t.howard@noaa.gov wrote:
>
> > enjoy and send in yer comments/patches!
>
> _ = Pervasives
>
> _.send(obj, message)

Ooh. I think that at least in the context of this lib, that's
reasonable enough.

Surely concise

Ara.T.Howard

1/6/2007 3:34:00 PM

0

Gregory Brown

1/6/2007 4:32:00 PM

0

On 1/6/07, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

> yeah - i thought about that, but i use '_' often in loops like
>
> hash.map{|k,_| k.upcase}
>
> when i plan to ignore a block param.

Hmm, also a good tip Ara, neat.

Trans

1/6/2007 9:21:00 PM

0


ara.t.howard@noaa.gov wrote:

> enjoy and send in yer comments/patches!

is this perhaps impossible b/c of callbacks? since any dot magic DSL is
created via method_missing how can we possibley remove all the methods
including #method_missing? and if we're stuck with one exception, what
does a half-dozen more really make (just so long as they have uncommon
names)?

t.