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

Time stored in a variable changes on every access #43

Closed
ltran opened this issue Mar 6, 2017 · 1 comment
Closed

Time stored in a variable changes on every access #43

ltran opened this issue Mar 6, 2017 · 1 comment

Comments

@ltran
Copy link

ltran commented Mar 6, 2017

When you store Time.now into a variable. Any access to the variable will always be different.

steps to reproduce.

15:11 $ icr
icr(0.21.0) > current_time = Time.now
 => 2017-03-06 15:38:40 -0800
icr(0.21.0) > current_time
 => 2017-03-06 15:38:43 -0800
icr(0.21.0) > current_time
 => 2017-03-06 15:38:48 -0800
icr(0.21.0) >

icr version

$ icr -v
icr version 0.2.13
Author: Potapov Sergey
Homepage: https://github.com/greyblake/crystal-icr

crystal-version

$ crystal -v
Crystal 0.21.0 (2017-02-21)
@ltran ltran changed the title Time stored in a variable changes when accessed Time stored in a variable changes on every access Mar 6, 2017
@greyblake
Copy link
Member

Thanks for being proactive and opening the issue.
However, there is nothing to do about it. It's due to nature, how icr implemented.

You should be careful using ICR with:

  • Network requests
  • File system
  • Time

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

2 participants