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

Lazy sequences break cursors #246

Closed
AshtonKem opened this issue Sep 30, 2014 · 7 comments
Closed

Lazy sequences break cursors #246

AshtonKem opened this issue Sep 30, 2014 · 7 comments

Comments

@AshtonKem
Copy link

@AshtonKem AshtonKem commented Sep 30, 2014

I know this has been mentioned in another issue, but this really tripped me up.

Any call to update! that returns a lazy sequence doesn't result in a sane cursor. This means that the first update works, but the second fails because you can't transact! a plain old fashioned list. The solution is to call vec inside of update!, which isn't a huge deal but it is confusing for new users.

@GetContented
Copy link

@GetContented GetContented commented Sep 30, 2014

Seems like a good candidate for a FAQ, or the troubleshooting section at https://github.com/swannodette/om/wiki/Troubleshooting

@AshtonKem
Copy link
Author

@AshtonKem AshtonKem commented Sep 30, 2014

That would be a good secondary choice. Ideally it should handle them
just as well as it handles vectors, perhaps by forcing them to be
non-lazy somehow or by working the same magic on lazy sequences that
currently works on vectors.

On 09/29/2014 08:05 PM, JulianLeviston wrote:

Seems like a good candidate for a FAQ, or the troubleshooting section at https://github.com/swannodette/om/wiki/Troubleshooting


Reply to this email directly or view it on GitHub:
#246 (comment)

Ashton

@GetContented
Copy link

@GetContented GetContented commented Sep 30, 2014

@AshtonKem is this the case for transact! too? Oh, of course not. Silly me ;-) The render-time access often confuses me.

@AshtonKem
Copy link
Author

@AshtonKem AshtonKem commented Sep 30, 2014

Apologies, I got my functions mixed up. I originally meant transact!,
but a quick test shows that update! has the exact same behavior.

On 09/29/2014 08:23 PM, JulianLeviston wrote:

@AshtonKem is this the case for transact! too?


Reply to this email directly or view it on GitHub:
#246 (comment)

Ashton

@GetContented
Copy link

@GetContented GetContented commented Sep 30, 2014

I'm a little confused... why are you using the return value of transact! or update! ?

Shouldn't you use the original cursor?

@GetContented
Copy link

@GetContented GetContented commented Sep 30, 2014

... or do you mean you shouldn't add a lazy sequence into an atom using transact or update?

@swannodette
Copy link
Member

@swannodette swannodette commented Sep 30, 2014

Not going to fix this, the documentation is very clear that everything in the app state must be an associative data structure.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.