Skip to content

ruby bound method comparison is a bit unfair #47

@martindemello

Description

@martindemello

the method example

o.my_method(5) == 15 # true
method_as_fun = o.my_method
# Wrong number of arguments, 0 for 1

misrepresents ruby, since you can get at the equivalent method object via

method_as_fun = o.method(:my_method)
method_as_fun(15) # error
method_as_fun[15] # works

still doesn't have pyret's substitutability, but the bound method is available and does the right thing when you call it, albeit with clunky syntactic support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions