[#2617] irb for 1.5.x — Andrew Hunt <Andy@...>
5 messages
2000/05/03
[#2639] OT: Japanese names — Dave Thomas <Dave@...>
4 messages
2000/05/09
[#2643] Ruby Toplevel — Dave Thomas <Dave@...>
7 messages
2000/05/09
[#2656] Re: Append alias for Array.append? — Aleksi Niemel<aleksi.niemela@...>
Hideto ISHIBASHI:
5 messages
2000/05/09
[#2660] win OLE / eRuby — Andrew Hunt <Andy@...>
8 messages
2000/05/09
[#2663] Re: win OLE / eRuby — Aleksi Niemel<aleksi.niemela@...>
>At Tue, 9 May 2000 09:14:51 -0400,
4 messages
2000/05/09
[#2667] The reference manual is now online — Dave Thomas <Dave@...>
6 messages
2000/05/09
[#2668] Re: The reference manual is now online — schneik@...
4 messages
2000/05/09
[#2702] Re: Append alias for Array.append? — Andrew Hunt <andy@...>
>From: Aleksi Niemel<aleksi.niemela@cinnober.com>
7 messages
2000/05/10
[#2752] RE: Array.pop and documentation [was: Append al ias for Array.append?] — Aleksi Niemel<aleksi.niemela@...>
6 messages
2000/05/11
[#2758] Re: irb install — Andrew Hunt <andy@...>
>|Excellent! Will you consider adding mod_ruby to install_app as
7 messages
2000/05/11
[#2777] Re: irb install
— "NAKAMURA, Hiroshi" <nakahiro@...>
2000/05/12
Hi,
[#2764] More code browsing questions — Albert Wagner <alwagner@...>
I see some class definitions contain "include" and "extend" statements.
6 messages
2000/05/12
[#2843] Re: editors for ruby — "Conrad Schneiker" <schneiker@...>
(Posted on comp.lang.ruby and ruby-talk ML.)
6 messages
2000/05/17
[#2874] RE: simple httpd for local use — Aleksi Niemel<aleksi.niemela@...>
> I personally use it for access to full-text indexed linux
6 messages
2000/05/18
[#2875] Re: simple httpd for local use
— hipster <hipster@...4all.nl>
2000/05/18
On Thu, 18 May 2000 09:10:28 +0200, Aleksi Niemelwrote:
[#2920] SWIG: virtual variable? — Yasushi Shoji <yashi@...>
hello,
4 messages
2000/05/22
[#2928] FYI: What our Python friends are up to. — "Conrad Schneiker" <schneiker@...>
Hi,
8 messages
2000/05/22
[#2964] Thank you — h.fulton@...
Thanks, Matz (and others) for your replies to
4 messages
2000/05/24
[#2973] Re: Socket.getnameinfo — ts <decoux@...>
>>>>> "D" == Dave Thomas <Dave@thomases.com> writes:
10 messages
2000/05/25
[#3016] rbconfig.rb — Dave Thomas <Dave@...>
5 messages
2000/05/28
[#3039] Re: Final for World Series: Python vs Ruby — "Dat Nguyen" <thucdat@...>
1 message
2000/05/30
[#3058] FailureClass? — Aleksi Niemel<aleksi.niemela@...>
Question arising from the FAQ:
7 messages
2000/05/31
[ruby-talk:02610] Re: Requiring more flexible require
From:
matz@... (Yukihiro Matsumoto)
Date:
2000-05-01 08:49:23 UTC
List:
ruby-talk #2610
Hi,
In message "[ruby-talk:02604] Requiring more flexible require"
on 00/04/28, mrilu <mrilu@ale.cx> writes:
|I thought to ask and provide an opportunity for someone to give me
|a glimpse of deep reasoning behind 'require'. Why it figures out the
|name of the initialization routine from given filename and why it
|looks strictly for the library file named as the given filename?
|
|Consider the following test case. I have foo.c and shared library libfoo.so .
|Then I have bar.c and it's using routine foo defined at foo.c, and there's
|another shared libbar.so .
|
|Then I want to use these from Ruby so I make wrappers (with SWIG) for
|both libraries, and make new shared libs libfoo_wrap.so and libbar_wrap.so.
|I really like to have them named _wrap because I have already programs
|which are using the libxxx.so versions. And I really like to have them
|prefixed 'lib' because on the C side the 'ld -lname' looks for libname.so.
|(I know I could cope with symlinks, but it feels clumsy for this one.)
|
|So we have ('->' means processed: compiled, generated shared library):
|foo.c -> foo.o -> libfoo.so
|bar.c -> bar.o with libfoo.so -> libbar.so
|progfoo.c -> with libfoo.so -> progfoo
|progbar.c -> with libbar.so -> progbar
|
|foo.c -> foo_wrap.c -> foo_wrap.o -> libfoo_wrap.so
|bar.c -> bar_wrap.c -> bar_wrap.o with libfoo_wrap.so -> libbar_wrap.so
|
|Now, few problems are raised:
|1) require 'foo'
|Does not work. There's no foo.so. Closest is libfoo.so but it's the
|C version, not the wrapped one.
|
|2) require 'foo_wrap'
|Does not work. There's no foo_wrap.so file. Should be libfoo_wrap.so.
|
|3) require 'libfoo_wrap'
|Does not work. There's no Init_libfoo_wrap routine in libfoo_wrap.so.
|There is, however, Init_Foo().
|
|4) require 'Foo'
|Does not work. Would call right initialization routine but unfortunately
|there's no Foo.so. So this needs link Foo.so -> libfoo_wrap.so. This in
|turn is a little bit confusing when we have foo.so around too.
|
|So my propose would be to change syntax and semantics for require.
First of all, you have to distinguish OS's shared libraries and Ruby's
dynamically loadable extension. They have both file extension (.so)
and in same binary format, but similarity ends there.
You have shared library libfoo.so and libbar.so, and wrapper routines
in foo.c and foo.bar. So why don't you choose foo.so and bar.so for
extension name? Ruby does not use `ld' inside. You don't need to
prefix extension names by `lib'.
Do I miss something?
matz.