to prevent namespace pollution from abitrary loaded files with code in it, I
had the idea to evaluate the code in anonymous modules, that are saved in a
hash (key is the filename/path).
worked so far, no problem.
then I tried to include the anonymous modules to have comfortable access to
the classes and methods of the corresponding files and guess what... it
worked!
include anonymous modules! whow! I am really impressed!
this language let me try things I would not think about in other languages.
thank you matz and the other developers for this great language!
benny
···
--
---------------------------------------------------------------------------------------------------
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
to prevent namespace pollution from abitrary loaded files with code in it, I
had the idea to evaluate the code in anonymous modules, that are saved in a
hash (key is the filename/path).
worked so far, no problem.
then I tried to include the anonymous modules to have comfortable access to
the classes and methods of the corresponding files and guess what... it
worked!
include anonymous modules! whow! I am really impressed!
this language let me try things I would not think about in other languages.
It's great to see that the creativity isn't capped with Ruby. It is
always surprising to find out what people like you can come up with. I
haven't freed up my mind like that yet.
thank you matz and the other developers for this great language!
Indeed. Big thanks. He saw a lot of this 10 years ago, can you imagine
how lucky we are? hehe
Matz 1.0 was great already.
Cheers,
Joao
···
On Thu, 10 Feb 2005 09:15:04 +0900, benny <listen@marcrenearns.de> wrote:
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
Totally off topic, but what a comment!
nikolai
···
--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
to prevent namespace pollution from abitrary loaded files with code in it, I
had the idea to evaluate the code in anonymous modules, that are saved in a
hash (key is the filename/path).
worked so far, no problem.
then I tried to include the anonymous modules to have comfortable access to
the classes and methods of the corresponding files and guess what... it
worked!
include anonymous modules! whow! I am really impressed!
this language let me try things I would not think about in other languages.
thank you matz and the other developers for this great language!
------------------------------------------------------------------------
Loads and executes the Ruby program in the file _filename_. If the
filename does not resolve to an absolute path, the file is searched
for in the library directories listed in +$:+. If the optional
_wrap_ parameter is +true+, the loaded script will be executed
under an anonymous module, protecting the calling program's global
namespace. In no circumstance will any local variables in the
loaded file be propagated to the loading environment.
$ cat x.rb
Foo = 5
puts "x here, is there a Foo? #{defined? Foo}"
$ cat y.rb
load 'x.rb', true
puts "y here, is there a Foo? #{defined? Foo}"
$ ruby y.rb
x here, is there a Foo? constant
y here, is there a Foo?
Bets that there are nocomments like that in any production Ruby app?
···
On Thu, 10 Feb 2005 09:38:50 +0900, Nikolai Weibull <mailing-lists.ruby-talk@rawuncut.elitemail.org> wrote:
* benny (Feb 10, 2005 01:30):
> Don't crash when a filter changes the subject of a message which results
> in the attempt to remove it from the tree of subject threading messages
> failing and the detached child looking for a new parent finding the old
> parent as the new parent, which in turn results in the child being deleted
> with the old (and new) parent, which is not a good idea, since it is
> still referenced.
> (Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
If you don't need to do anything with the anonymous namespace:
$ ri Kernel#load
yes I know, but I needed to reuse the modules later
benny
···
--
---------------------------------------------------------------------------------------------------
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being
deleted with the old (and new) parent, which is not a good idea, since it
is still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
Totally off topic, but what a comment!
nikolai
I saw this commit message on the kde cvs-digest and wanted to use it as
signature. so I asked Mr. Adams if I may. He was amused and gave me the ok.
its a bit long for the usenet so I will replace it as soon as I made my
first ruby-onliner poem
It needs parentheses and syntax highlighting (colour verb-like bits red)...
Don't crash when ((a filter changes (the subject of a message)) which
results
in (the attempt to remove it from (the tree of subject threading messages)
failing) and ((the detached child looking for a new parent) finding the old
parent as the new parent), which in turn results in (the child being deleted
with (the old \(and new\) parent), (which is not a good idea, since it is
still referenced))).
Don't crash when a filter changes the subject of a message which results
in the attempt to remove it from the tree of subject threading messages
failing and the detached child looking for a new parent finding the old
parent as the new parent, which in turn results in the child being
deleted
with the old (and new) parent, which is not a good idea, since it is
still referenced.
(Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD, 6. Jan. 2005)
> > Don't crash when a filter changes the subject of a message which
> > results in the attempt to remove it from the tree of subject
> > threading messages failing and the detached child looking for a
> > new parent finding the old parent as the new parent, which in
> > turn results in the child being deleted with the old (and new)
> > parent, which is not a good idea, since it is still referenced.
> > > > (Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD,
> > 6. Jan. 2005)
> Totally off topic, but what a comment!
>
Bets that there are nocomments like that in any production Ruby app?
> > > Don't crash when a filter changes the subject of a message which
> > > results in the attempt to remove it from the tree of subject
> > > threading messages failing and the detached child looking for a
> > > new parent finding the old parent as the new parent, which in
> > > turn results in the child being deleted with the old (and new)
> > > parent, which is not a good idea, since it is still referenced.
> > > > > (Till Adams commit on kdepim/kmail/kmheaders.cpp in HEAD,
> > > 6. Jan. 2005)
>
> > Totally off topic, but what a comment!
> >
>
> Bets that there are nocomments like that in any production Ruby app?
Instead we get huge mysterious memory leaks.
This is a problem with all the languages, even with the garbage
collected ones. "More creativity + More done" is the real cause of
the memory leaks in languages like Ruby. But Java too has such
problems, mind you. It's good to bring up this because reality is
usually a little bit harder in every language.
Regards,
Joao
···
On Thu, 10 Feb 2005 10:16:20 +0900, Navindra Umanee <navindra@cs.mcgill.ca> wrote: