Actions
Bug #11296
closedProc#arity returns weird value for non-lambda proc with optional arguments
Bug #11296:
Proc#arity returns weird value for non-lambda proc with optional arguments
Description
Proc.new(x=0){}.arity returns 0, not -1 unlike lambdas.
I don't remember if it's intentional or not. Anyone remember?
Matz.
Updated by nobu (Nobuyoshi Nakada) about 11 years ago
- Status changed from Open to Feedback
Proc.new(x=0){} raises an ArgumentError for me, in 1.8..2.3.
Updated by Hanmac (Hans Mackowiak) about 11 years ago
Updated by znz (Kazuhiro NISHIYAMA) about 11 years ago
Updated by matz (Yukihiro Matsumoto) about 11 years ago
Hans, thank you. That's what I meant.
Kazuhiro, #7765 suggests that seems intentional.
After hearing opnion from others, I will close the issue (unless meaningful discussion starts).
Matz.
Updated by marcandre (Marc-Andre Lafortune) about 11 years ago
Updated by matz (Yukihiro Matsumoto) about 11 years ago
- Status changed from Feedback to Closed
Marc-Andre, thank you for the info. You have made the issue clear.
Now I can safely close the issue.
Matz.
Updated by usa (Usaku NAKAMURA) about 11 years ago
- Status changed from Closed to Rejected
Actions