[#138] Thread Problems — Reimer Behrends <behrends@...>

I have been looking at the thread implementation of Ruby for the past

21 messages 1998/12/23
[#164] Re: Thread Problems — matz@... (Yukihiro Matsumoto) 1999/01/05

Hi.

[#167] Makefiles and -lcurses — Klaus.Schilling@... 1999/01/05

Julian Fondren writes:

[#168] Re: Makefiles and -lcurses — Julian Fondren <julian@...> 1999/01/05

OpenBSD has ncurses and it's own ocurses, and I prefer the latter.

[ruby-talk:00151] Re: Win32 callback into Ruby code?

From: matz@... (Yukihiro Matsumoto)
Date: 1998-12-27 15:35:05 UTC
List: ruby-talk #151
Hi.

In message "[ruby-talk:00145] Win32 callback into Ruby code?"
    on 98/12/25, "Bryce" <crowdog@siscom.net> writes:

|I have not seen this anywhere for Ruby but I was
|wondering if anyone knows of a way of using a Ruby
|function as a "callback" in a Win32 environment?
|
|Example:
|    myRubyfunction ()
|        print "a"
|    end
|
|    win32.somefunction (  &myRubyFunction )
|
|    # now, somefunction will callback to myRubyFunction

Well, Ruby can objectify blocks and methods, but you can't get C
function pointer out of them.  (It maybe possible if Ruby has a full
compiler.)  It's not Ruby's fault, but just C can't have closures in
portable way.  But most of the case, callbacks receive the client
data, so you can pass Ruby procedure object as client data, and invoke
it in the callback function, to emulate closures.

                                                matz.

In This Thread

Prev Next