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

Add an EvalScript method to FsiEvaluationSession #36

Closed
forki opened this issue Jan 23, 2014 · 18 comments
Closed

Add an EvalScript method to FsiEvaluationSession #36

forki opened this issue Jan 23, 2014 · 18 comments

Comments

@forki
Copy link
Member

forki commented Jan 23, 2014

I just read http://fsharp.github.io/FSharp.Compiler.Service/interactive.html and saw fsiSession.EvalExpression(text) allows to evaluate an expression.
For fsprojects/FAKE#41 I would need an EvalScript method.

Is this possible?

@ghost
Copy link

ghost commented Jan 23, 2014

EvalInteraction should do the trick, I think.

@7sharp9
Copy link
Member

7sharp9 commented Jan 23, 2014

Im sure Ive used it for loading a script before.

@7sharp9
Copy link
Member

7sharp9 commented Jan 23, 2014

You could always add an augmenter in Fake to read the file into a string.

I would like the opposite, a way of sending a string to fsi, rather than passing a script file. (Given that fsi is made a few orders of magnitude faster starting first)

@panesofglass
Copy link

Does an overload or additional method exist that takes a Stream? That's a lcm approach that would also work for hosting this on a web server and directly passing the request body to the evaluator.

@7sharp9
Copy link
Member

7sharp9 commented Jan 24, 2014

The original inputs were stream based.

On 24 Jan 2014, at 02:41, Ryan Riley notifications@github.com wrote:

Does an overload or additional method exist that takes a Stream? That's a lcm approach that would also work for hosting this on a web server and directly passing the request body to the evaluator.


Reply to this email directly or view it on GitHub.

@forki
Copy link
Member Author

forki commented Jan 24, 2014

OK thanks will look into EvalInteraction and probably add some notes to the docs if it works.

@forki
Copy link
Member Author

forki commented Jan 24, 2014

Im sure Ive used it for loading a script before.

Do you have a link? Do get it wortking. Always getting evaluation errors

@ghost
Copy link

ghost commented Feb 4, 2014

@forki can you give more details of the errors you are getting. Using

EvalInteraction("""#load "script.fsx" """) 

should work I think.

@forki
Copy link
Member Author

forki commented Feb 4, 2014

mhm. I tried to load the script file into string and evaluate the string. This #load trick sounds better. Actually it sounds useful enough to be extracted into own method.

@ghost
Copy link

ghost commented Feb 4, 2014

Please send a PR to add that?

@forki
Copy link
Member Author

forki commented Feb 4, 2014

if I succeed I will send a PR

@forki
Copy link
Member Author

forki commented Feb 4, 2014

Seems to work. I smell FAKE 3.0 in the air.

@panesofglass
Copy link

👍 I'm giddy with delight to see this. Correct me if I'm wrong, but shouldn't this allow for dynamic dependencies, similar to what @t0yv0 describes in https://github.com/Intellifactory/fshake?

@forki
Copy link
Member Author

forki commented Feb 4, 2014

Actually I just want to run FSI in the same thread to get better debugging of build scripts. But I'm not sure this will work

@forki
Copy link
Member Author

forki commented Feb 5, 2014

image

ok this is the first time a FAKE build stopped the debugger. yaaaaay

1236963278_spring-board-jump

any ideas why it is one line to far? Maybe the #load directive?

@forki
Copy link
Member Author

forki commented Feb 5, 2014

image

it's reproducable at different positions

@ghost
Copy link

ghost commented Mar 10, 2014

@forki any update on this? Is there an FCS issue here?

@ghost
Copy link

ghost commented Mar 12, 2014

Closing for now

This issue was closed.
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

3 participants