[#86984] Attempted roadmap of future instance variables.... — "David A. Black" <dblack@...>

Hi --

81 messages 2003/12/02
[#86998] Re: Attempted roadmap of future instance variables.... — Steve Tuckner <STUCKNER@...> 2003/12/02

So what is the relationship between @_ vars and @vars that are defined in a

[#87001] Re: Attempted roadmap of future instance variables.... — "David A. Black" <dblack@...> 2003/12/02

Hi --

[#87006] Re: Attempted roadmap of future instance variables.... — Steve Tuckner <STUCKNER@...> 2003/12/02

Maybe I am being dense, so bear with me...

[#87011] Re: Attempted roadmap of future instance variables.... — Lyle Johnson <lyle@...> 2003/12/02

Steve Tuckner wrote:

[#87013] Re: Attempted roadmap of future instance variables.... — Steve Tuckner <STUCKNER@...> 2003/12/02

OK so the jist of it is that @_var variables are stored with the class of

[#87095] Re: Attempted roadmap of future instance variables.... — "Robert Klemme" <bob.news@...> 2003/12/03

[#87098] Re: Attempted roadmap of future instance variables.... — "David A. Black" <dblack@...> 2003/12/03

Hi --

[#87102] Re: Attempted roadmap of future instance variables.... — ts <decoux@...> 2003/12/03

>>>>> "D" == David A Black <dblack@wobblini.net> writes:

[#87244] Re: Attempted roadmap of future instance variables.... — "Christoph" <chr_mail@...> 2003/12/05

ts wrote:

[#87275] Re: Attempted roadmap of future instance variables.... — ts <decoux@...> 2003/12/05

>>>>> "C" == Christoph <chr_mail@gmx.net> writes:

[#87286] Re: Attempted roadmap of future instance variables.... — "Christoph" <chr_mail@...> 2003/12/05

ts wrote:

[#87290] Re: Attempted roadmap of future instance variables.... — "David A. Black" <dblack@...> 2003/12/05

Hi --

[#87308] Re: Attempted roadmap of future instance variables.... — Austin Ziegler <austin@...> 2003/12/05

On Fri, 5 Dec 2003 22:56:41 +0900, David A. Black wrote:

[#87310] Re: Attempted roadmap of future instance variables.... — "Christoph" <chr_mail@...> 2003/12/05

Austin Ziegler wrote:

[#87314] Re: Attempted roadmap of future instance variables.... — "T. Onoma" <transami@...> 2003/12/05

On Friday 05 December 2003 05:40 pm, Christoph wrote:

[#87318] Re: Attempted roadmap of future instance variables.... — matz@... (Yukihiro Matsumoto) 2003/12/05

Hi,

[#87335] Re: Attempted roadmap of future instance variables.... — Nathaniel Talbott <nathaniel@...> 2003/12/05

On Dec 5, 2003, at 12:15, Yukihiro Matsumoto wrote:

[#87320] Re: Attempted roadmap of future instance variables.... — Austin Ziegler <austin@...> 2003/12/05

On Sat, 6 Dec 2003 01:40:42 +0900, Christoph wrote:

[#87322] Re: Attempted roadmap of future instance variables.... — "T. Onoma" <transami@...> 2003/12/05

On Friday 05 December 2003 06:41 pm, Austin Ziegler wrote:

[#87066] What's the best way to create methods dealing with an object of a certain class? — Leif K-Brooks <eurleif@...>

I want to add a method to be run on Strings. Currently, I'm just adding

14 messages 2003/12/03
[#87072] Re: What's the best way to create methods dealing with an object of a certain class? — Lyle Johnson <lyle@...> 2003/12/03

Leif K-Brooks wrote:

[#87083] Some Regexp — orlovdn@... (Dmitry N Orlov)

I want to get array from file like this:

20 messages 2003/12/03

[#87203] sorting — vanjac12@... (Van Jacques)

I'm not sure where to post about this problem, so

18 messages 2003/12/04

[#87233] Generalized break? — Hal Fulton <hal9000@...>

I hate to bring up possible language changes, since there is

14 messages 2003/12/04

[#87255] WeakRef and Object#hash — Samuel Tesla <samuel@...>

I'm trying to implement a weak key hash to use for generic objects.

37 messages 2003/12/05
[#87259] Dumb question to which I ought to know the answer by now — "Mark J. Reed" <markjreed@...> 2003/12/05

Is there an assignment version of Hash#values_at, so I can assign

[#87266] Re: Dumb question to which I ought to know the answer by now — Austin Ziegler <austin@...> 2003/12/05

On Fri, 5 Dec 2003 12:42:05 +0900, Mark J. Reed wrote:

[#87333] Re: Attempted roadmap of future instance variables.... — "Weirich, James" <James.Weirich@...>

From: David A. Black [mailto:dblack@wobblini.net]

18 messages 2003/12/05
[#87337] Re: Attempted roadmap of future instance variables.... — Chris Thomas <chris@...> 2003/12/05

[#87402] Re: Attempted roadmap of future instance variables.... — matz@... (Yukihiro Matsumoto) 2003/12/06

Hi,

[#87382] Idea: Linux PIM in Ruby — Hal Fulton <hal9000@...>

On my wishlist of top 20 things I'd like to do: A PIM for Linux.

30 messages 2003/12/06
[#87407] Re: Idea: Linux PIM in Ruby — Lyle Johnson <lyle@...> 2003/12/06

Hal Fulton wrote:

[#87409] rbbr-0.5.0 — Masao Mutoh <mutoh@...>

Hi,

18 messages 2003/12/06

[#87430] Ideas for replacing $0==__FILE__ — Hal Fulton <hal9000@...>

I've accepted now that my "generalized break" was a bad idea. In

26 messages 2003/12/06
[#87720] Re: Ideas for replacing $0==__FILE__ — Eric Hodel <drbrain@...7.net> 2003/12/10

Hal Fulton (hal9000@hypermetrics.com) wrote:

[#87723] Re: Ideas for replacing $0==__FILE__ — Hal Fulton <hal9000@...> 2003/12/10

Eric Hodel wrote:

[#87726] Re: Ideas for replacing $0==__FILE__ — Eric Hodel <drbrain@...7.net> 2003/12/10

Hal Fulton (hal9000@hypermetrics.com) wrote:

[#87459] Trying to create a Ruby daemon — Samuel Kvarnbrink <samuel.kvarnbrink@...>

Hi,

11 messages 2003/12/07

[#87553] format money — saggmannen@... (saggmannen)

Hello, is there a way to format "Money"-style floats in ruby. E.g:

25 messages 2003/12/08

[#87587] Adjusting the Scope of Blocks — Mark Cox <mark_cox@...>

Hi,

22 messages 2003/12/09
[#87606] Re: Adjusting the Scope of Blocks — "Robert Klemme" <bob.news@...> 2003/12/09

[#87620] Re: Adjusting the Scope of Blocks — "David A. Black" <dblack@...> 2003/12/09

Hi --

[#87626] ANN: REXML 2.7.2 — ser@... (Sean Russell)

Hi,

18 messages 2003/12/09

[#87638] Inheriting variables, super, and "not super"? — Hugh Sasse Staff Elec Eng <hgs@...>

Is there a way in a method to say

11 messages 2003/12/09

[#87706] Docs for Socket, OpenSSL, etc — "James F. Hranicky" <jfh@...>

Are there any plans to add docs for modules like Socket and OpenSSL, etc to

23 messages 2003/12/10
[#87766] Re: Docs for Socket, OpenSSL, etc — Simon Strandgaard <neoneye@...> 2003/12/11

On Wed, 10 Dec 2003 23:20:21 +0900, James F. Hranicky wrote:

[#87769] Re: Docs for Socket, OpenSSL, etc — "James F. Hranicky" <jfh@...> 2003/12/11

On Thu, 11 Dec 2003 20:57:00 +0900

[#87780] Re: Docs for Socket, OpenSSL, etc — Dave Thomas <dave@...> 2003/12/11

[#87781] Re: Docs for Socket, OpenSSL, etc — "James F. Hranicky" <jfh@...> 2003/12/11

On Fri, 12 Dec 2003 00:07:28 +0900

[#87775] prog for g.c.d. of 2 integers — vanjac12@... (Van Jacques)

Topics from mathematics make good practice programs, IMO.

13 messages 2003/12/11

[#87783] problems with racc: $end token — "Luke A. Kanies" <luke@...>

Hello,

14 messages 2003/12/11
[#87789] Re: problems with racc: $end token — Jim Freeze <jim@...> 2003/12/11

On Friday, 12 December 2003 at 0:42:30 +0900, Luke A. Kanies wrote:

[#87819] Ruby-Talk Subject Matters — "T. Onoma" <transami@...>

Out of curiosity, how do others feel about "suggestive" threads? Do you feel

15 messages 2003/12/11

[#87856] Simple issue giving problems — Brad <coish@...>

Hello all,

17 messages 2003/12/11

[#88031] inplace assignment — "T. Onoma" <transami@...>

is there anyway, anyway at all, ugly hacks accepted, of doing inplace

40 messages 2003/12/14
[#88032] Re: inplace assignment — Hal Fulton <hal9000@...> 2003/12/14

T. Onoma wrote:

[#88034] Re: inplace assignment — "T. Onoma" <transami@...> 2003/12/14

On Sunday 14 December 2003 05:51 am, Hal Fulton wrote:

[#88037] Re: inplace assignment — Hal Fulton <hal9000@...> 2003/12/14

T. Onoma wrote:

[#88041] Re: inplace assignment — "T. Onoma" <transami@...> 2003/12/14

On Sunday 14 December 2003 07:49 am, Hal Fulton wrote:

[#88056] Re: inplace assignment — "David A. Black" <dblack@...> 2003/12/14

On Sun, 14 Dec 2003, T. Onoma wrote:

[#88059] Re: inplace assignment — "T. Onoma" <transami@...> 2003/12/14

On Sunday 14 December 2003 03:59 pm, David A. Black wrote:

[#88064] Re: inplace assignment — "David A. Black" <dblack@...> 2003/12/14

On Mon, 15 Dec 2003, T. Onoma wrote:

[#88077] All there is to know about Duck Typing (was: inplace assignment) — "T. Onoma" <transami@...> 2003/12/14

Alright, a number of things related to Duck Tpying have been popping up and I

[#88081] Re: All there is to know about Duck Typing (was: inplace assignment) — "David Naseby" <david.naseby@...> 2003/12/14

> -----Original Message-----

[#88147] extremely strange segfault — "Luke A. Kanies" <luke@...>

Hi all,

14 messages 2003/12/15

[#88150] UnboundMethods Useless? — "T. Onoma" <transami@...>

Urrrr.....

34 messages 2003/12/15
[#88239] Re: UnboundMethods Useless? — Dan Doel <djd15@...> 2003/12/16

You can do stuff like this:

[#88309] Re: UnboundMethods Useless? — "T. Onoma" <transami@...> 2003/12/17

On Tuesday 16 December 2003 08:54 pm, Dan Doel wrote:

[#88322] Re: UnboundMethods Useless? — Chad Fowler <chad@...> 2003/12/17

On Wed, 17 Dec 2003, T. Onoma wrote:

[#88323] Re: UnboundMethods Useless? — ts <decoux@...> 2003/12/17

>>>>> "C" == Chad Fowler <chad@chadfowler.com> writes:

[#88327] Re: UnboundMethods Useless? — "T. Onoma" <transami@...> 2003/12/17

On Wednesday 17 December 2003 01:21 pm, ts wrote:

[#88328] Re: UnboundMethods Useless? — ts <decoux@...> 2003/12/17

>>>>> "T" == T Onoma <transami@runbox.com> writes:

[#88332] Re: UnboundMethods Useless? — "T. Onoma" <transami@...> 2003/12/17

On Wednesday 17 December 2003 01:59 pm, ts wrote:

[#88333] Re: UnboundMethods Useless? — "David A. Black" <dblack@...> 2003/12/17

On Wed, 17 Dec 2003, T. Onoma wrote:

[#88336] Re: UnboundMethods Useless? — Peter <Peter.Vanbroekhoven@...> 2003/12/17

> I don't know what you mean by (ir)reversible, but the point is that

[#88337] Re: UnboundMethods Useless? — ts <decoux@...> 2003/12/17

>>>>> "P" == Peter <Peter.Vanbroekhoven@cs.kuleuven.ac.be> writes:

[#88159] Re: Extracting multiple lines from a file — "Berger, Daniel" <djberge@...>

> -----Original Message-----

18 messages 2003/12/15
[#88161] Re: Extracting multiple lines from a file — "Ron Coutts" <rcoutts@...> 2003/12/15

[#88166] Re: Extracting multiple lines from a file — "Mark J. Reed" <markjreed@...> 2003/12/15

On Tue, Dec 16, 2003 at 07:16:23AM +0900, Ron Coutts wrote:

[#88199] Re: Extracting multiple lines from a file — Derek Lewis <lewisd@...00f.net> 2003/12/16

On Tue, 16 Dec 2003, Mark J. Reed wrote:

[#88172] Copying methods from one class to another — "T. Onoma" <transami@...>

Is there any way to copy a method from one class to another?

22 messages 2003/12/16
[#88174] Re: Copying methods from one class to another — Jamis Buck <jgb3@...> 2003/12/16

T. Onoma wrote:

[#88183] Re: Copying methods from one class to another — "T. Onoma" <transami@...> 2003/12/16

On Tuesday 16 December 2003 05:23 am, Jamis Buck wrote:

[#88189] Re: Copying methods from one class to another — "David A. Black" <dblack@...> 2003/12/16

On Tue, 16 Dec 2003, T. Onoma wrote:

[#88191] Re: Copying methods from one class to another — "T. Onoma" <transami@...> 2003/12/16

On Tuesday 16 December 2003 02:51 pm, David A. Black wrote:

[#88195] Re: Copying methods from one class to another — Hacksaw <hacksaw@...> 2003/12/16

Sorry to step into the middle of a conversation, but what does this mean:

[#88211] Newbie questions — jfrapper@... (Jim Frapper)

I was wondering what the equivalent tools were to perldoc(ri is not)

44 messages 2003/12/16
[#88259] Re: Newbie questions — Chad Fowler <chad@...> 2003/12/16

On Wed, 17 Dec 2003, Jim Frapper wrote:

[#88266] Re: Newbie questions — Gavin Sinclair <gsinclair@...> 2003/12/16

On Wednesday, December 17, 2003, 8:10:19 AM, Chad wrote:

[#88270] Re: Newbie questions — Daniel Carrera <dcarrera@...> 2003/12/16

>

[#88271] Re: Newbie questions — "Luke A. Kanies" <luke@...> 2003/12/16

On Wed, 17 Dec 2003, Daniel Carrera wrote:

[#88272] Re: Newbie questions — Daniel Carrera <dcarrera@...> 2003/12/16

On Wed, Dec 17, 2003 at 07:07:45AM +0900, Luke A. Kanies wrote:

[#88280] Re: Newbie questions — "Luke A. Kanies" <luke@...> 2003/12/16

On Wed, 17 Dec 2003, Daniel Carrera wrote:

[#88370] Re: Newbie questions — Derek Lewis <lewisd@...00f.net> 2003/12/17

[#88220] Re: Newbie questions — "Berger, Daniel" <djberge@...>

> -----Original Message-----

31 messages 2003/12/16
[#88224] Re: Newbie questions — Hal Fulton <hal9000@...> 2003/12/16

Berger, Daniel wrote:

[#88227] Re: Newbie questions — Thomas Adam <thomas_adam16@...> 2003/12/16

--- Hal Fulton <hal9000@hypermetrics.com> wrote:

[#88228] Re: Newbie questions — Hal Fulton <hal9000@...> 2003/12/16

Thomas Adam wrote:

[#88289] Very odd IO problem — Brad <coish@...>

All:

18 messages 2003/12/17

[#88414] Yukihiro - Please ensure backwards compatibility — jobeicus@... (Joseph Benik)

having recently migrated one of my machines from a 1.6 flavor to the

14 messages 2003/12/18

[#88494] How to return more than one result from a method? — Tim Hunter <cyclists@...>

I'm trying to code a method that has two result values. The values are

14 messages 2003/12/19

[#88581] replacing two EOL chars by one — xah@... (Xah Lee)

i have a bunch of java files that has spaced-out formatting that i

23 messages 2003/12/20

[#88643] Ruby 1.8.1 preview4 — matz@... (Yukihiro Matsumoto)

Hi,

32 messages 2003/12/22

[#88731] RubyGems and dependencies — sera@... (Francis Hwang)

Two RubyGems questions about dependencies:

16 messages 2003/12/23

[#88781] TkText freezes — quillion <me@...>

Hello all,

21 messages 2003/12/24

[#88814] ruby 1.8.1 — matz@... (Yukihiro Matsumoto)

Merry Christmas,

25 messages 2003/12/24

[#88936] Inconsistent value of uninitialized variable — Gavin Sinclair <gsinclair@...>

The following statement, free of all context, generates an error:

10 messages 2003/12/28

[#88954] An addition to Array (or Enumerable)? — Harry Ohlsen <harryo@...>

Yesterday, I wanted to get the output from "ls -l some_file" and pull out just the file size and the file name. As I start writing this, I realise, of course, that I'd have been better off just using the File#size method, but I still think the issue I hit is interesting.

12 messages 2003/12/28

[#89015] ruby-dev summary 22273-22434 — "Takaaki Tateishi" <ttate@...>

Hello,

16 messages 2003/12/30
[#89016] Re: ruby-dev summary 22273-22434 — Austin Ziegler <austin@...> 2003/12/30

On Wed, 31 Dec 2003 00:45:11 +0900, Takaaki Tateishi wrote:

Re: Underpinnings of Method Wrapping

From: "T. Onoma" <transami@...>
Date: 2003-12-09 09:03:57 UTC
List: ruby-talk #87609
On Tuesday 09 December 2003 01:05 am, Peter wrote:
> PS: I'm not crawling back, I'm just waiting for you to refute all I've
> been saying :-)

Haha! Y9ou knew I would ;-)

> Actually your example above could prove to be a useful application of
> cflow. Suppose during compilation you'd have to do a number of tasks, and
> each has a number of subtasks, and each of those too, etc. Suppose that
> some of the tasks need to be run in a chroot environment, but you'd want
> to run as little as possible in a chroot environment (say because that
> minimizes security risks). You'd then have a main method called compile,
> and a bunch of methods that either need to be wrapped in a chroot or not,
> but you can't make a clear separation in the call tree between the two
> kinds of methods. I'll give a simple example:

Sure, I think that can work. Try something like:

  class Compiler
    def compile
      task1
      task2
    end

    def task1:chroot
      task2
      task3
    end

    def task2:chroot
      ...
    end

    def task3
      ...
    end
  end

  Compiler.aspect do |meth|
    if meth.tag==:chroot   
      meth.wrap do
	if doer.cflow_ancestors.any? {|a| a.tag==:chroot}
          super
        else
          chroot_evironment do
            super
          end
        end
      end
    end
  end

QUICK SIDE NOTE: might be nice to have something for all those dang ends. How 
about end_____end, with as many underscore (2 or more) as needed:

  Compiler.aspect do |meth|
    if meth.tag==:chroot   
      meth.wrap do
	if doer.cflow_ancestors.any? {|a| a.tag==:chroot}
          super
        else
          chroot_evironment do
            super
  end_____end

Anyway, 'doer' references the current method being executed. I think this 
psuedo-notation is about right. Of course, the same effect, could also be 
achieved explictly by setting a flag within the code itelf, say @chroot = 
true, and coding each method to act on that flag. But then we miss the point 
of AOP: seperation of concerns. Using AOP we can make the aspect independent 
of class Compiler. So not only is it more flexible, but we could define it 
sepatately and then reuse it on other classes.

> For task1 we'd need to create the chroot environment. For task2 too, but
> not when it is called from a method that already created a chroot env. For
> task3 we need not create a chroot env, but we need to break one down when
> called from a chrooted method. If we have a number of tasks like this, it
> becomes cumbersome to code this in a consistent way. And thus we can use
> AOP techniques. And to see whether we are in a chroot environment already,
> we can use cflow. But we need to be able to limit it to the direct caller.
> But suppose we have some real small tasks that don't require a chroot
> environment, but are too insignificant to break down and rebuild the
> environment for. I remember saying that cflow is technically not required,
> you can do the same with just wrappers. So maybe we should do it
> explicitly in Ruby then. The only point of cflow is that if it's a
> recurring concept, it might be worth to have a separate notion of that in
> Ruby. But what I don't like about cflow is that unless we can find a much
> completer notion to describe conditions based on control flow, using it
> may cause troubles too. If the condition becomes more complex, then it's
> possible we can't describe it anymore in cflow logic and thus we need to
> make it explicit anyway. If it was explicit in the first place, we'd need
> to change less. I don't know if you're still with me...

cflow logic is certainly a different way of thinking, but I don't really see 
how cflow logic would become so complex that you'd want to go back to 
explicts. It's essentially the same logic, actually, just applied 
differently. In fact I think one will find that the ease of managing such 
aspects are on an order of magnitude greater than explictly doing so. I don;t 
see cflow being the the essential part of AOP, but it is another useful part 
of it.

> BTW, about [ruby-talk:86785]... Correct me if I'm wrong, but the idea
> there is that you want to have a wrap that is always the outermost wrap,
> even if methods are redefined in subclasses, much like the problem of the
> chroot environment you presented. But I think I still need to be convinced
> of the use of wraps in such cases because it can easily be done with
> current Ruby (using template patterns and alike). Granted, wrapping can do
> the same thing in-place. But is that necessary? If a wrap is supposed to
> stay in place, like in case of your chroot creation, it seems natural to
> use something template-like. OK, that exposes more methods, like the
> real_compile in my previous post, but that's a more general problem of
> visibility that's cross-cutting. It's the problem C++ tries to solve in a
> clumsy way using friend classes, and what Matz tries to solve using
> namespaces (but implementation-wise this is hard to do efficiently in a
> dynamic language as Matz mentions on his slides). And actually with wraps
> there's the problem that wraps are anonymous (unless we use indicators, or
> allow to index the wrap stack, which is definitely yuck), but using
> template-like things and subroutines, that's not a problem for all has a
> name.

Well, sort-of, in 86785 I was showing how we might mixin singletons in a class 
definable way, which is the essence of wrapping. Its not that they are outer 
or inner per se; I wasn't thinking about that at the time, and is something 
additional to take into consideration (currently they would indeed be outer 
though). We can already define mixin singletons in an object definable way 
using #extend. You may have read about that in a couple of my recent posts on 
the matter (87408 is good starting point in the thread).

I'm not sure what your refering to with c friend classes and namespaces. Do 
you mean instance variable visibility? Sorry if I'm just forgetting something 
here. If this the case though, my take is that since wraps are implict they 
should have access as if they were the same class. Perhaps outer wraps should 
not and inner wraps should. Its just something that needs to be thought 
through to come up with the best way. I think indicators are awesome by the 
way :), but wrap indexing I agree is yuk, and I can only imagine it can do 
nothing but cause weird ugly code hacks --nothing of really great use. But if 
the indexing functionality is there it doesn't so much matter as long as its 
not something one HAS to deal with. I doubt it would get much use.

As for "neccessity", this consideration is the very distinction between 
explict/specific and implict/generic. It some cases the former is a must. In 
fact the core of any program is explict, but the more one can generalize, the 
more flexible, powerful and reusable are the solutions. I think one can see 
it clearly if they've seen something like my GUI wrapper (despit the hack 
that it is to achieve a current effect of wrapping) It really is quite 
something to take an existing class and without touching a lick of code in 
it, give it a GUI interface.

> I'm just thinking aloud now, after reading up on AspectJ stuff. What
> bothers me is that while reading the AspectJ stuff again, my reaction is
> continually "so what, we can do that in Ruby already". (I learned Ruby
> after I learned about AspectJ.) The first picture they show in their talks
> is a schematic representation of the lines of code in the different source
> files of the apache web server code. They show that XML parsing code is
> located in 1 file. They show that URL pattern matching code is only in two
> files (because it's a class and it's subclass). But then logging is spread
> all over the place. But then I say to myself that we in Ruby don't have
> such a problem. We are not forced to place the code of one class or module
> by itself in one file. So we can perfectly move all the code concerned
> with logging into one file. We can even make it generic so we don't need
> to write the same code over and over again. This shows again that Matz
> wasn't born yesterday. A class-based source file system forces you to put
> all the code related to manipulating the same bit of data in one file,
> even if code has parts that are about completely different concerns. Ruby
> allows you to also split code based on the different concerns. If you
> combine that thought with the idea of mix-ins (which the AspectJ guys try
> to do using inter-class declarations, aka "open classes"), Ruby seems to
> have more advantages than AspectJ will ever have.

I agree, Ruby has it over Java by a long shot -- I am sometimes dumb-struck 
that Java is so popular. Although I understand too, because I think Ruby 
still has some maturing to do. But nonethess we can do many things with Ruby 
that runs circles around Java. But to me that also means, with the addition 
of good AOP fetures, Ruby will be even that much more beyond anything else 
out there. In fact I think that the features we are now discussing, are so 
fundementally mind-blowing once you start to understand thier power, that 
combined with already amazing abilities of Ruby, this could become the one of 
the things that really distinguishes Ruby from the the rest of pack --the 
thing that will draw people to Ruby over other language choices. Do you know 
what I mean? I mean really, AOP as easy as this? My god, It's frig'n 
incredible!!! Okay, I'm getting a little excited ;)

> I don't know if you see where I'm going. I don't know if I see where I'm
> going. But my conclusion seems to be that for internal wraps, we make
> things more complicated by using wraps, rather than solve things. What we
> seem to struggle with are things like the order of the wraps, removing
> wraps, redefining wraps, etc, and these seem really hard when there are
> wraps, but not when we'd use things like templates and subroutines etc
> because then we already have explicit power to manipulate all of that.

I don't think these are so much a struggle. For the most part I see how it can 
be done. Much of the difficulty I think is fitting it into Ruby's syntax 
without too much "back breaking". Also, you think its a tough coming up with 
a good notation for removing wraps? Try removing 10,000 explict wraps from a 
1,000,000 lines of code. ;-)

> However I do believe there is use in what we call external wraps, which
> are really just hooks that get called when another method gets called, but
> are not part of the intrinsic functionality of the method they wrap. The
> gain there is that they are really invisible to the rest of the program,
> only they know they are there. And for those wraps, things like the order
> of the wraps in the stack doesn't matter or removal on prime method
> redefinition. But I feel that for intrinsic wraps we seem to be using the
> wrong mechanism. It seems to take away explicit control, and we are now
> looking for a way to give it back. If you know what I mean.

On the contrary, but I think I've explained it enough in the above. Right off 
the bat my GUI interface would not be possible, and truth be told, we are 
already doing this kind of thing quite often by aliasing methods and then 
redefining them with call backs to the original. Worse, when this is done  
genericlly we end up with a bunch of __was_meth__ clutter. So inner wraps are 
already here, but we need a clean and powerful way to do it right.

> Maybe a final note... There are some features AspectJ has that we don't
> have in Ruby (or at least that I know of). In AspectJ a method can be
> called when a variable is read/assigned (easy for a compiled language).
> Also exception handlers are join points. Note that we could add hooks
> there, but not without the hooked ones explicitly providing that
> possiblity.

I think the latter can already be done actually. Well, I may be wrong about 
that, but its close b/c error classes are/can be instantiated, which means 
you can hook into the initialize method. As for the former, you're right, 
ther are no callback methods for assignment, there has been talk of this and 
we may one day see it, but it would probably be too much overhead. I think 
localizing instance variables will be good enough though, because you can 
wrap accessor methods.

T.

> PPS: Sorry for rambling on for so many kilobytes

Don't be silly, that's what kilobytes were made for! :)



In This Thread