T
Trans
class D
def initialize(&blk)
@blk = blk
end
def lambda_return
lambda { return 'Y' }.call ; 'N'
end
def proc_return
Proc.new { return 'Y' }.call ; 'N'
end
def lambda_return_blk
lambda(&@blk).call ; 'N'
end
def proc_return_blk
Proc.new(&@blk).call ; 'N'
end
end
d = D.new { return 'Y' }
p d.lambda_return
p d.proc_return
p d.lambda_return_blk
p d.proc_return_blk
_produces_
"N"
"Y"
"N"
LocalJumpError
Anyway to get the last to return the "Y"?
Thanks,
T.
def initialize(&blk)
@blk = blk
end
def lambda_return
lambda { return 'Y' }.call ; 'N'
end
def proc_return
Proc.new { return 'Y' }.call ; 'N'
end
def lambda_return_blk
lambda(&@blk).call ; 'N'
end
def proc_return_blk
Proc.new(&@blk).call ; 'N'
end
end
d = D.new { return 'Y' }
p d.lambda_return
p d.proc_return
p d.lambda_return_blk
p d.proc_return_blk
_produces_
"N"
"Y"
"N"
LocalJumpError
Anyway to get the last to return the "Y"?
Thanks,
T.