Project

General

Profile

Actions

Bug #9520

closed

Arity of a Proc obtained by Symbol#to_proc

Added by prijutme4ty (Ilya Vorontsov) about 10 years ago. Updated about 10 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:60752]

Description

I'm not sure is it a bug, but I find this behavior wrong.
:to_s.to_proc.arity # => -1
but isn't :to_s.to_proc is the same as ->(x){x.to_s} whose arity is 1?

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Status changed from Open to Rejected

The proc created by Symbol#to_proc is not a lambda, but a proc, which accepts arbitrary number arguments.

Actions

Also available in: Atom PDF

Like0
Like0