-
Notifications
You must be signed in to change notification settings - Fork 323
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
Implement Vector.build
#9304
Comments
A couple questions:
|
@GregoryTravis I think the idea is that IOW: It doesn't mutate an existing builder that's coming in from another node As for why we can't use a value-returning lambda - I imagine it's because sometimes we want to be able to append to a lambda, e.g. when iterating: enso/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Result_Set.enso Lines 20 to 26 in fda41cb
|
Greg Travis reports a new STANDUP for today (2024-04-16): Progress: Dataflow Error stack traces; sent final Decimal PRs; implemented Vector.build and started converting uses of new_builder It should be finished by 2024-04-19. Next Day: convert uses of .new_builder to .build |
Good point, I guess I used wrong phrasing. Both have side effects, but with It is a bit like the difference between Haskell's
Not efficiency but practicality. I think for some algorithms it is just simpler to have a builder. For example, if I want to compute a running sum over a vector - tbh I'm not sure how I could do that with I guess the usual functional pattern would be to use |
Create That's because IDE is intercepting individual method invocations and caching their results. That is not going to happen in case of the lambda. |
Good question. I believe with the proposed |
@jdunkerley What is an example of using |
Greg Travis reports a new STANDUP for today (2024-04-17): Progress: Converting Base/ uses of .new_builder to .build It should be finished by 2024-04-19. Next Day: convert uses of .new_builder to .build? |
Greg Travis reports a new STANDUP for today (2024-04-18): Progress: hash/equals consistency It should be finished by 2024-04-19. Next Day: convert uses of .new_builder to .build? |
@JaroslavTulach suggested introducing a new way of using the Vector Builder:
As we have all agreed this is a very good idea. It will allow us to use the builder in the IDE safely - the current approach would be unsafe to use in the GUI due to being to relying on side-effects.
We probably will want to call the operation
Vector.build
.Vector.build
that runs the provided lambda with a newly created builder, then seals it and returns as its result the built vector.Vector.each
ignores dataflow errors raised in the function #9250).set
for the builder. The builder relies onappend
and that is enough for now. We can addset
if needed, but not as part of this ticket.Vector.new_builder
as deprecated.Vector.new_builder
.Vector.build
instead.Vector.new_builder
altogether. If not, let's remove it as part of the followup ticket.The text was updated successfully, but these errors were encountered: