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

Support for typed functions #3

Closed
dereckmezquita opened this issue Jul 6, 2024 · 0 comments
Closed

Support for typed functions #3

dereckmezquita opened this issue Jul 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dereckmezquita
Copy link
Owner

Description

Allow for defining functions with typed arguments and return values. This would require a mechanism for extending base R types.

Implementation Ideas

function2 <- interface("function",
    arg1 = "numeric",
    arg2 = "character",
    return = "numeric"
)

# Implement the function
f2 <- implement(function2, function(arg1, arg2) {
    return(arg1 + nchar(arg2))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant