Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion how to do instance_eval with arguments

View parsed - Show only message text

Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.arglkargh.de!noris.net!not-for-mail
From: Yukihiro Matsumoto <m...@ruby-lang.org>
Newsgroups: comp.lang.ruby
Subject: Re: how to do instance_eval with arguments
Date: Thu, 9 Feb 2006 08:00:51 +0900
Lines: 18
Message-ID: <1139439636.290041.12259.nullmailer@x31.priv.netlab.jp>
References: <71299b7c0a28800a7476f583118a5e2f@ruby-forum.com>
NNTP-Posting-Host: sinus.lauschmusik.de
Content-Type: text/plain; charset=US-ASCII
X-Trace: ork-un.noris.net 1139439681 13660 213.95.32.201 (8 Feb 2006 23:01:21 GMT)
X-Complaints-To: news@noris.net
NNTP-Posting-Date: Wed, 8 Feb 2006 23:01:21 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
   the ruby-talk mailing list by a gateway at lauschmusik.de. If it is
   SPAM, it did not originate at lauschmusik.de. Please report the 
   original sender, and not us. Thanks!
   Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
In-Reply-To: <71299b7c0a28800a7476f583118a5e2f@ruby-forum.com>
X-ML-Name: ruby-talk
X-Mail-Count: 179046
X-ruby-talk: <1139439636.290041.12259.nullmai...@x31.priv.netlab.jp>
X-rubymirror: yes

Hi,

In message "Re: how to do instance_eval with arguments"
    on Thu, 9 Feb 2006 07:33:53 +0900, Jim Weirich <j...@weirichhouse.org> writes:
|
|I'm prototyping a DSL and came across a situtation where I have a lambda 
|that I would like to give to instance_eval, but the lambda takes 
|arguments.  Instance_eval will not supply any arguments when evaluating 
|the lambda and I don't see a straightforward way around this.
|
|Any suggestions?

CVS HEAD (1.9) has instance_exec method that works exactly what you
want. 

							matz.



Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google