Bug #5966
closed->{} doesn't work in BasicObject
Description
=begin
$ ./ruby -ve 'BasicObject.new.instance_eval { ->{} }'
ruby 2.0.0dev (2012-02-03 trunk 34424) [x86_64-linux]
-e:1:in block in <main>': undefined method
lambda' for #BasicObject:0x007ffff847ef28 (NoMethodError)
from -e:1:in instance_eval' from -e:1:in
'
I'm not sure it is a bug or not, but I think lambda syntax should work everywhere.
=end
Files
Updated by nobu (Nobuyoshi Nakada) almost 13 years ago
- File 0001-Bug-5966-lambda-in-BasicObject.patch 0001-Bug-5966-lambda-in-BasicObject.patch added
- Status changed from Open to Assigned
- Assignee set to ko1 (Koichi Sasada)
I'm not sure why FCALL is dealt specially in op_send.
It doesn't seem needed if self is put instead of nil.
Updated by ko1 (Koichi Sasada) over 12 years ago
Hi,
(2012/02/11 6:56), Nobuyoshi Nakada wrote:
File 0001-Bug-5966-lambda-in-BasicObject.patch added
Status changed from Open to Assigned
Assignee set to Koichi Sasada
Thank you. Please commit it.
I'm not sure why FCALL is dealt specially in op_send.
It doesn't seem needed if self is put instead of nil.
It is a historical reason. No reason now.
--
// SASADA Koichi at atdot dot net
Updated by nobu (Nobuyoshi Nakada) over 12 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r34819.
Kazuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- compile.c (iseq_compile_each): call on special object instead of
self. since stabby lambda is a syntax, so it should not be
affected by the context. [ruby-core:42349][Bug #5966] - insns.def (send): no special deal for FCALL. self should be put
on TOS instead.