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 nested Computation Expression for writing Builder Like DSLs #420

Closed
baronfel opened this issue Oct 20, 2016 · 0 comments
Closed

Allow nested Computation Expression for writing Builder Like DSLs #420

baronfel opened this issue Oct 20, 2016 · 0 comments
Labels

Comments

@baronfel
Copy link
Contributor

baronfel commented Oct 20, 2016

Allow nested Computation Expression for writing Builder Like DSLs [7199500]

Submitted by Robert Kuzelj on 3/12/2015 12:00:00 AM
5 votes on UserVoice prior to migration

type DirectionBuilder() =
member self.Yield(()) = []
[<CustomOperation("left")>]
member self.Left (acc, degree) = somefn degree
[<CustomOperation("right")>]
member self.Right (acc, degree) = somefn degree
[<CustomOperation("velocity")>]
member self.Velocity (acc, ()) = new VelocityBuilder()
and VelocityBuilder() =
member self.Yield(()) = []
[<CustomOperation("accelerate")>]
member self.Accesslarate (acc, v) = somefn v
[<CustomOperation("decelerate")>]
member self.Decelerate (acc, v) = somefn v
let direction () = new DirectionBuilder()
direction() {
right 90
left 30
velocity() {
accelerate 1
}
}

Response

** by fslang-admin on 7/18/2015 12:00:00 AM **

Many thanks for this suggestion. It is being marked as declined – for discussion see the comments.
Further discussion welcome
Don Syme, F# Language and Core Library Evolution.

Original UserVoice Submission
Archived Uservoice Comments

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

No branches or pull requests

1 participant