Currently custom REPL commands allow returning an object which is then dumped as a string to the REPL.
This feature will introduce an method that will accessing the return value as an object.
Example using a fictional :http_get command which creates an HTTP request.
:http_get www.yahoo.com
var result = GetResult<HttpResponseMessage>();
Console.WriteLine(result.StatusCode);
In this case :http_get is a REPL command that uses HttpClient to make a request. It then returns the response. GetResult then retrieves the previous result and casts it as a response message.
Another option would be to dynamically create a variable on the fly of type HttpResponseMessage and compile it in via a submission.
Using this approach will allow cleanly to transition from the command world to code.
Currently custom REPL commands allow returning an object which is then dumped as a string to the REPL.
This feature will introduce an method that will accessing the return value as an object.
Example using a fictional :http_get command which creates an HTTP request.
In this case
:http_getis a REPL command that uses HttpClient to make a request. It then returns the response. GetResult then retrieves the previous result and casts it as a response message.Another option would be to dynamically create a variable on the fly of type HttpResponseMessage and compile it in via a submission.
Using this approach will allow cleanly to transition from the command world to code.