Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining methods on a class when a generic is a specific type #21

Open
cooper opened this issue Oct 4, 2016 · 1 comment
Open

Defining methods on a class when a generic is a specific type #21

cooper opened this issue Oct 4, 2016 · 1 comment

Comments

@cooper
Copy link
Owner

cooper commented Oct 4, 2016

This is sorta an extension of #18.

class List <T=Str>

method join {
    need $by: Str
    $c = ""
    for $str in *self {
        $c += $str
    }
    return $c
}

This is a bad example because .join() exists for all types since all types are stringifiable.

@cooper
Copy link
Owner Author

cooper commented Nov 20, 2016

This will probably never happen. Not sure it'd actually be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant