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

Allow evaluating void return methods #95

Open
huantianad opened this issue Dec 11, 2021 · 2 comments
Open

Allow evaluating void return methods #95

huantianad opened this issue Dec 11, 2021 · 2 comments

Comments

@huantianad
Copy link

Allow for the evaluation of methods which return void purely for the side effect, possibly under an option.

Not sure how actively maintained this project is any more, I do see @hunkydoryrepair has a more active repo with some bug fixes, but not sure if this one is active anymore.

@hunkydoryrepair
Copy link
Contributor

I'm not sure your suggestion makes sense. How would you use a void method in an expression? Only the code necessary for evaluation is run. Can you give an example? You can always create you own methods that have a side effect and then return a value (ie. return this).

@huantianad
Copy link
Author

Yeah my workaround has just been to return null.
My use case is generally evaluating a method directly, for example, I could want to evaluate an expression like Console.WriteLine(1 + 1), which I'm only calling to evaluate the insides of the function and print it into the console (probably not something I would do).

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

No branches or pull requests

2 participants