[#63439] Re: Local variables & blocks — Brian Candler <B.Candler@...>

> >>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

22 messages 2003/02/01
[#63482] Re: Local variables & blocks — ts <decoux@...> 2003/02/02

>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:

[#63485] Re: Local variables & blocks — Brian Candler <B.Candler@...> 2003/02/02

On Sun, Feb 02, 2003 at 09:30:12AM +0100, ts wrote:

[#63486] Re: Local variables & blocks — ts <decoux@...> 2003/02/02

>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:

[#63491] Re: Local variables & blocks — Brian Candler <B.Candler@...> 2003/02/02

> Y> I'm afraid I won't give you a way to turn it off. It is "quite

[#63492] Re: Local variables & blocks — ts <decoux@...> 2003/02/02

>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:

[#63495] Re: Local variables & blocks — Brian Candler <B.Candler@...> 2003/02/02

On Sun, Feb 02, 2003 at 12:36:52PM +0100, ts wrote:

[#63496] Re: Local variables & blocks — ts <decoux@...> 2003/02/02

>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:

[#63479] no override — Tom Sawyer <transami@...>

is there any way to specifiy that a method can not be overrided? perfereably

20 messages 2003/02/02
[#63483] Re: no override — Mauricio Fern疣dez <batsman.geo@...> 2003/02/02

On Sun, Feb 02, 2003 at 04:51:08PM +0900, Tom Sawyer wrote:

[#63487] Re: no override — Mauricio Fern疣dez <batsman.geo@...> 2003/02/02

On Sun, Feb 02, 2003 at 06:41:45PM +0900, Mauricio Fern疣dez wrote:

[#63500] Re: no override — Tom Sawyer <transami@...> 2003/02/02

On Sunday 02 February 2003 03:34 am, Mauricio Fern疣dez wrote:

[#63517] Re: no override — Mauricio Fern疣dez <batsman.geo@...> 2003/02/02

On Sun, Feb 02, 2003 at 09:35:26PM +0900, Tom Sawyer wrote:

[#63527] Re: no override — Tom Sawyer <transami@...> 2003/02/02

On Sunday 02 February 2003 09:01 am, Mauricio Fern疣dez wrote:

[#63553] What is the best Ruby IDE you think? — Nicolay Vasiliev <n.vasiliev@...>

Hello!

14 messages 2003/02/03

[#63600] ruby-dev summary 19437-19455 — Minero Aoki <aamine@...>

Hi all,

17 messages 2003/02/03

[#63751] Embedding Ruby in C code — Szymon Drejewicz <drejewic@...>

How to compile this file:

24 messages 2003/02/05

[#63782] Error in Complex — Daniel Carrera <dcarrera@...>

Hello,

18 messages 2003/02/05

[#63829] locana, SVG, cross-platform GUI meanderings... — ptkwt@...1.aracnet.com (Phil Tomson)

Hold on, this post takes a few twists and turns. Consider it an exercise

41 messages 2003/02/06
[#63832] Re: locana, SVG, cross-platform GUI meanderings... — Holden Glova <dsafari@...> 2003/02/06

-----BEGIN PGP SIGNED MESSAGE-----

[#63859] Re: locana, SVG, cross-platform GUI meanderings... — Richard Kilmer <rich@...> 2003/02/06

[#63862] Blogging software — Martin DeMello <martindemello@...>

Anyone done any work on a ruby-powered weblog?

15 messages 2003/02/06

[#63906] The way of the Gentoo — "MikkelFJ" <mikkelfj-anti-spam@...>

22 messages 2003/02/06

[#63938] Private lvalue methods unusable? — Steven Smolinski <steven.smolinski@...>

I'm learning Ruby, and trying to grasp the non-declarative concept with

14 messages 2003/02/06

[#64018] easy access for CGI query — Wakou Aoyama <wakou@...>

hello,

14 messages 2003/02/07

[#64063] Tortured by the Dependency Daemons — Jonathan Smith <jonathan.w.smith@...>

The instructions for installation state, "In RWiki package for your

16 messages 2003/02/08

[#64068] Relative performance of Ruby templating systems — "Gabriel Emerson" <egabriel@...>

I decided to run Siege against Mod Ruby, ERuby, Amrita, PageTemplate,

11 messages 2003/02/08

[#64146] ruby-dev summary 19457-19539 — Kazuo Saito <ksaito@...>

10 messages 2003/02/09
[#64151] Operator reordering, good idea? (was Re: ruby-dev summary 19457-19539) — Sam Roberts <sroberts@...> 2003/02/09

Hi, I'm just a beginner buy program, but...

[#64164] Trapping Access/Modification of Objects — Jason Voegele <jason@...>

After a long delay, I'm now starting to work on the RubyGOODS library

13 messages 2003/02/09

[#64242] Source code for "Ruby Developer's Guide" — Harry Ohlsen <harryo@...>

Hi People,

15 messages 2003/02/10

[#64247] turning modules into classes — "Chris Pine" <nemo@...>

Did you ever want to instantiate a module?

28 messages 2003/02/10
[#64251] Re: turning modules into classes — dblack@... 2003/02/10

Hi --

[#64278] inheriting from base classes — dblack@...

Hi --

37 messages 2003/02/11

[#64329] Range#length? — "Chris Pine" <nemo@...>

What happened to Range#length and Range#size?

39 messages 2003/02/11

[#64392] String frustration — "Tim Kynerd" <tim@...>

Hi everyone,

23 messages 2003/02/11

[#64421] Name for #=== based assertion — <nathaniel@...>

I've had several requests that an assertion based on #=== be added to

16 messages 2003/02/12

[#64470] Need regex help (or bug in match) — Jim Freeze <jim@...>

Hi

17 messages 2003/02/12
[#64471] Re: Need regex help (or bug in match) — dblack@... 2003/02/12

Hi --

[#64549] Re: Can we attack the 'not enough libraries' thing straight on? — "Hal E. Fulton" <hal9000@...> 2003/02/12

----- Original Message -----

[#64524] mod_ruby insecury op — Daniel Bretoi <lists@...>

[Wed Feb 12 12:00:16 2003] [error] mod_ruby: error in ruby

15 messages 2003/02/12

[#64527] Windows support — Daniel Carrera <dcarrera@...>

Hello,

17 messages 2003/02/12

[#64528] hm,... arr[1]["name"] — "daniel" <offstuff@...>

$arr = Array();

16 messages 2003/02/12

[#64575] Re: Lexical scope and closures — patrickdlogan@...

> (3) some other syntax will be introduced for cases where...

53 messages 2003/02/12
[#64647] Re: Lexical scope and closures — Mauricio Fern疣dez <batsman.geo@...> 2003/02/13

On Thu, Feb 13, 2003 at 08:35:34AM +0900, patrickdlogan@attbi.com wrote:

[#64670] Re: Lexical scope and closures — Brian Candler <B.Candler@...> 2003/02/13

On Thu, Feb 13, 2003 at 05:44:36PM +0900, Mauricio Fern?ndez wrote:

[#64678] Re: Lexical scope and closures — Tom Sawyer <transami@...> 2003/02/13

On Thursday 13 February 2003 04:54 am, Brian Candler wrote:

[#64750] Re: Lexical scope and closures — matz@... (Yukihiro Matsumoto) 2003/02/14

Hi,

[#64751] Re: Lexical scope and closures — Tom Sawyer <transami@...> 2003/02/14

On Thursday 13 February 2003 06:44 pm, Yukihiro Matsumoto wrote:

[#64755] Re: Lexical scope and closures — matz@... (Yukihiro Matsumoto) 2003/02/14

Hi,

[#64756] Re: Lexical scope and closures — Tom Sawyer <transami@...> 2003/02/14

On Thursday 13 February 2003 07:42 pm, Yukihiro Matsumoto wrote:

[#64855] Re: Lexical scope and closures — "Marcin 'Qrczak' Kowalczyk" <qrczak@...> 2003/02/15

Sat, 15 Feb 2003 08:06:31 +0900, Mauricio Fern疣dez <batsman.geo@yahoo.com> pisze:

[#64920] Re: Lexical scope and closures — dblack@... 2003/02/16

Hi --

[#64602] von Rossum on Strong vs. Weak Typing — <jbritt@...>

Since this is something of a permathread on this list I though this would be of interest:

33 messages 2003/02/13
[#64606] Re: von Rossum on Strong vs. Weak Typing — Ryan Pavlik <rpav@...> 2003/02/13

On Thu, 13 Feb 2003 10:10:44 +0900

[#64778] Re: von Rossum on Strong vs. Weak Typing — "Marcin 'Qrczak' Kowalczyk" <qrczak@...> 2003/02/14

Thu, 13 Feb 2003 13:15:42 +0900, Yukihiro Matsumoto <matz@ruby-lang.org> pisze:

[#64789] Re: von Rossum on Strong vs. Weak Typing — Paul Brannan <pbrannan@...> 2003/02/14

On Fri, Feb 14, 2003 at 07:27:10PM +0900, Marcin 'Qrczak' Kowalczyk wrote:

[#64793] Re: von Rossum on Strong vs. Weak Typing — Matt Armstrong <matt@...> 2003/02/14

Paul Brannan <pbrannan@atdesk.com> writes:

[#64804] Re: von Rossum on Strong vs. Weak Typing — Paul Brannan <pbrannan@...> 2003/02/14

On Sat, Feb 15, 2003 at 01:05:19AM +0900, Matt Armstrong wrote:

[#64811] Re: von Rossum on Strong vs. Weak Typing — Dan Sugalski <dan@...> 2003/02/14

At 4:18 AM +0900 2/15/03, Paul Brannan wrote:

[#64626] Why does Array#compact! return the array, but uniq! return a count? — Sam Roberts <sroberts@...>

11 messages 2003/02/13

[#64752] why html template systems never use new tags? — Tom Sawyer <transami@...>

curious, i've realized that i have never seen any html template systems that

16 messages 2003/02/14

[#64753] module This::Encompassing::That — Bil Kleb <W.L.Kleb@...>

Today, I decided I was tired of

45 messages 2003/02/14
[#64754] Re: module This::Encompassing::That — dblack@... 2003/02/14

Hi --

[#64757] Re: module This::Encompassing::That — Bil Kleb <W.L.Kleb@...> 2003/02/14

dblack@candle.superlink.net wrote:

[#64850] Re: module This::Encompassing::That — Gavin Sinclair <gsinclair@...> 2003/02/15

On Friday, February 14, 2003, 2:00:56 PM, Bil wrote:

[#64859] Re: module This::Encompassing::That — dblack@... 2003/02/15

Hi --

[#64883] Re: module This::Encompassing::That — Gavin Sinclair <gsinclair@...> 2003/02/15

On Sunday, February 16, 2003, 4:01:47 AM, dblack wrote:

[#64986] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/17

Hi,

[#64987] Re: module This::Encompassing::That — ts <decoux@...> 2003/02/17

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#64988] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/17

Hi,

[#64990] Re: module This::Encompassing::That — ts <decoux@...> 2003/02/17

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#65046] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/17

Hi,

[#65078] Re: module This::Encompassing::That — ts <decoux@...> 2003/02/18

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#65085] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/18

Hi,

[#65137] Re: module This::Encompassing::That — Gavin Sinclair <gsinclair@...> 2003/02/18

On Tuesday, February 18, 2003, 11:56:41 PM, Yukihiro wrote:

[#65151] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/19

Hi,

[#65160] Re: module This::Encompassing::That — nobu.nokada@... 2003/02/19

Hi,

[#65178] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/19

Hi,

[#65211] Re: module This::Encompassing::That — <nathaniel@...> 2003/02/19

Yukihiro Matsumoto [mailto:matz@ruby-lang.org] wrote:

[#65225] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/19

Hi,

[#65230] Re: module This::Encompassing::That — dblack@... 2003/02/19

Hi --

[#65235] Re: module This::Encompassing::That — matz@... (Yukihiro Matsumoto) 2003/02/19

Hi,

[#64785] Segmation fault in combination of heavy socket I/O and multi-threading — Idan Sofer <idan@...>

This is one bug(Or perhaps even a set of bugs) I ran into more then once

10 messages 2003/02/14
[#65118] Re: [BUG] Segmation fault in combination of heavy socket I/O and multi-threading — ts <decoux@...> 2003/02/18

>>>>> "I" == Idan Sofer <idan@idanso.dyndns.org> writes:

[#65001] How to test for existence of instance variable? — Brian Candler <B.Candler@...>

I have an existing class Foo, and existing objects of that class.

42 messages 2003/02/17
[#65017] Re: How to test for existence of instance variable? — "Bill Kelly" <billk@...> 2003/02/17

Hi,

[#65081] Re: How to test for existence of instance variable? — Brian Candler <B.Candler@...> 2003/02/18

On Mon, Feb 17, 2003 at 10:46:59AM -0800, Bill Kelly wrote:

[#65084] Re: How to test for existence of instance variable? — matz@... (Yukihiro Matsumoto) 2003/02/18

Hi,

[#65110] Re: How to test for existence of instance variable? — Paul Brannan <pbrannan@...> 2003/02/18

On Tue, Feb 18, 2003 at 09:52:12PM +0900, Yukihiro Matsumoto wrote:

[#65112] Re: How to test for existence of instance variable? — matz@... (Yukihiro Matsumoto) 2003/02/18

Hi,

[#65125] Re: How to test for existence of instance variable? — Paul Brannan <pbrannan@...> 2003/02/18

On Wed, Feb 19, 2003 at 02:08:07AM +0900, Yukihiro Matsumoto wrote:

[#65179] Re: How to test for existence of instance variable? — matz@... (Yukihiro Matsumoto) 2003/02/19

Hi,

[#65196] Re: How to test for existence of instance variable? — Brian Candler <B.Candler@...> 2003/02/19

On Wed, Feb 19, 2003 at 05:19:15AM +0900, Paul Brannan wrote:

[#65201] Re: How to test for existence of instance variable? — Paul Brannan <pbrannan@...> 2003/02/19

On Thu, Feb 20, 2003 at 12:02:21AM +0900, Brian Candler wrote:

[#65090] $SAFE and creating New objects (File) — "\"RayZ\" Andrew V Rumm" <rayz@...>

Sorry for noob question

16 messages 2003/02/18

[#65141] String#+ operatorbroken? — Jim Freeze <jim@...>

Hi:

17 messages 2003/02/19

[#65159] Sourcing files — Bjn Lindstr <bkhl@...>

I like using source files as configuration files for my hacks.

13 messages 2003/02/19

[#65167] Ruby scripts for daily unix system administration — "Useko Netsumi" <usenets@...>

Hi, I'm a newbie looking for any example of writing ruby script to do my

22 messages 2003/02/19

[#65212] Rite Status? — Travis Whitton <whitton@...>

Hello all - I was just wondering if Rite is still in development and if it's

16 messages 2003/02/19

[#65270] optimization question — Travis Whitton <whitton@...>

Hello - A friend and I have been working on a Ruby implementation of a

39 messages 2003/02/19

[#65292] Curses base windowing system — "Useko Netsumi" <usenets@...>

As I have only limited resources on my laptop(memory, diskspace, and CPU

17 messages 2003/02/20

[#65331] Return Values of [] for Array, Hash,... (ruby 1.6.8) — Michael Bruschkewitz <brusch2@...>

Hello,

12 messages 2003/02/20

[#65351] proc {} vs. Method#to_proc — dblack@...

Hi --

22 messages 2003/02/20

[#65424] Regexp help: Parsing a CSV file — Tim Bates <tim@...>

I've dumped a CSV (comma separated values) file from Excel, and I want to

27 messages 2003/02/21

[#65454] xml-configfile 0.8.0 — Maik Schmidt <contact@...>

Yo!

14 messages 2003/02/21

[#65473] Style question: using 'block_given?' — Bill Dueber <wdueber@...>

I'm new to Ruby, and want to know what The Best Way To Do It is...

21 messages 2003/02/21
[#65485] Re: Style question: using 'block_given?' — Brian Candler <B.Candler@...> 2003/02/21

On Sat, Feb 22, 2003 at 05:00:44AM +0900, Bill Dueber wrote:

[#65494] Re: Style question: using 'block_given?' — Mauricio Fern疣dez <batsman.geo@...> 2003/02/21

On Sat, Feb 22, 2003 at 06:05:23AM +0900, Brian Candler wrote:

[#65498] Re: Style question: using 'block_given?' — Brian Candler <B.Candler@...> 2003/02/21

> This is the class instance variable police. Freeze! Keine Bewegung!

[#65511] Re: Style question: using 'block_given?' — dblack@... 2003/02/22

Hi --

[#65514] Re: Style question: using 'block_given?' — Brian Candler <B.Candler@...> 2003/02/22

On Sat, Feb 22, 2003 at 04:05:59PM +0900, dblack@candle.superlink.net wrote:

[#65526] embedded docs — Wojciech Kaczmarek <schatten@...>

Is ruby going to have (in a reasonably predictable future :) embedded

50 messages 2003/02/22
[#65567] Re: embedded docs — Simon Cozens <simon@...> 2003/02/23

Brian Wisti <brian@coolnamehere.com> writes:

[#65572] Re: embedded docs — Piers Harding <piers@...> 2003/02/23

[#65573] Re: embedded docs — Seth Kurtzberg <seth@...> 2003/02/23

I agree that this is very important.

[#65576] Internationalization (Re: embedded docs) — Brian Wisti <brian@...> 2003/02/23

On Sunday 23 February 2003 09:18 am, Seth Kurtzberg wrote:

[#65577] Re: Internationalization (Re: embedded docs) — Seth Kurtzberg <seth@...> 2003/02/23

On Sunday 23 February 2003 10:53 am, Brian Wisti wrote:

[#65601] ANN: REXML 2.5.7 and 2.4.7 — ser@... (Sean Russell)

Two, two, TWO releases for the price of one!

13 messages 2003/02/24

[#65619] Coding challenge: Space-separated constants — "Hal E. Fulton" <hal9000@...>

I'm issuing this challenge because I'm

12 messages 2003/02/24

[#65632] Happy Birthday, Ruby, and an announcement.... — dblack@...

Dear everyone,

18 messages 2003/02/24

[#65644] Debugger Not Working — Seth Kurtzberg <seth@...>

All,

26 messages 2003/02/24
[#65779] Re: Debugger Not Working — "NAKAMURA, Hiroshi" <nahi@...> 2003/02/26

Hi, Seth,

[#65784] Re: Debugger Not Working — Seth Kurtzberg <seth@...> 2003/02/26

It is working now with line numbers. What is the syntax for breaking at a

[#65786] Re: Debugger Not Working — "NAKAMURA, Hiroshi" <nahi@...> 2003/02/26

Hi, Seth,

[#65790] Re: Debugger Not Working — Seth Kurtzberg <seth@...> 2003/02/26

It may, I'll try it, but it really doesn't do much good even if it does work.

[#65791] Re: Debugger Not Working — "NAKAMURA, Hiroshi" <nahi@...> 2003/02/26

Hi, Seth,

[#65660] Objectify the mersenne twister in 1.8? — Robert Feldt <feldt@...>

Hi,

17 messages 2003/02/24

[#65802] Ruby in Performance Testing — E F van de Laar <emiel@...>

Rubyists,

18 messages 2003/02/26

[#65835] Re: von Rossum on Strong vs. Weak Typing — "Marcin 'Qrczak' Kowalczyk" <qrczak@...>

Thu, 13 Feb 2003 10:10:44 +0900, <jbritt@ruby-doc.org> <jbritt@ruby-doc.org> pisze:

12 messages 2003/02/26

[#65854] Ruby Compile-time optimization — Daniel Carrera <dcarrera@...>

Hello,

52 messages 2003/02/27

[#65884] Unable to do non-blocking read on socket — Seth Kurtzberg <seth@...>

I have not been able to change the behavior of IO::read() to non-blocking.

27 messages 2003/02/27
[#65920] Re: Unable to do non-blocking read on socket — nobu.nokada@... 2003/02/27

Hi,

[#65937] Re: Unable to do non-blocking read on socket — Seth Kurtzberg <seth@...> 2003/02/27

This is with 1.8 CVS head on linux kernel 2.4.20.

[#66126] Re: Unable to do non-blocking read on socket — nobu.nokada@... 2003/03/02

Hi,

[#66146] Re: Unable to do non-blocking read on socket — Seth Kurtzberg <seth@...> 2003/03/02

I guess I must be missing something, but I see nothing here that would expose

[#66149] Re: Unable to do non-blocking read on socket — matz@... (Yukihiro Matsumoto) 2003/03/02

Hi,

[#65907] XmlConfigFile usage — Ollivier Robert <roberto@...>

Hello,

31 messages 2003/02/27
[#65943] Re: XmlConfigFile usage — "Chris Morris" <chrismo@...> 2003/02/27

> I underestimated the need for true XML serialization and I think it's

[#65945] Re: XmlConfigFile usage — Brian Candler <B.Candler@...> 2003/02/27

On Fri, Feb 28, 2003 at 01:53:47AM +0900, Chris Morris wrote:

[#65991] I'm stuck — Friedrich Dominicus <frido@...>

Well my problem sounds IMHO trivial.

31 messages 2003/02/28

Re: General question about args (embedded code)

From: Lyle Johnson <lyle@...>
Date: 2003-02-25 01:11:19 UTC
List: ruby-talk #65698
Ben Thomas wrote:

> There is a lot of function in the Ruby C API that takes the
> 
>     VALUE (*body)(), VALUE args
> 
> combo parameters (such as rb_protect, or rb_rescue), and I don't 
> understand how I should pass multiple arguments with such declaration. 
> For example, how should I rb_protect a function call like this?
> 
>     rb_const_get( rb_cObject, rb_intern( "Foo" ) );
> 
> I saw other source cde like this:
> 
>     VALUE args[2];
>     args[0] = rb_cObject;
>     args[1] = rb_intern( "Foo" );
> 
>     rb_protect( rb_const_get, args, &result );
> 
> But this kind of code doesn't works (and just don't make sense for me 
> after what I read from eval.c, but maybe I'm missing something).

It is *very* non-obvious (at first glance) how functions like 
rb_rescue() and rb_protect() work.

The second argument to rb_protect() is just a pointer to "some data", 
and the contents of that data are up to you. That data pointer will be 
passed as the single argument to the function you pass as the first 
argument to rb_protect(), so when you write:

     rb_protect(func, data, &result);

you should understand that Ruby will execute the line:

     func(data);

For the example you described, it's not working because the function 
rb_const_get() is expecting two arguments, not one. So what to do?

This usually means you'll need to provide a "helper" function for the 
function you're actually trying to "protect". Still using your example 
scenario, let's cook up a helper for rb_const_get() that takes just one 
argument:

     VALUE rb_const_get_helper(VALUE data)
     {
         VALUE *args = (VALUE *) data;
         return rb_const_get(args[0], args[1]);
     }


Here, we're assuming that 'data' points to a C array of VALUEs, and that 
array has two elements. This function just turns around and calls the 
real function, rb_const_get(), with the correct number of arguments. To 
activate this with rb_protect(), we can now use the original snippet you 
posted:

     VALUE args[2];
     VALUE result;
     int state;

     args[0] = rb_cObject;
     args[1] = rb_intern("Foo");

     result = rb_protect(rb_const_get_wrapper, (VALUE) &args[0], &state);

Hope this helps,

Lyle


In This Thread