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

Listing 1.7, line 28, change of global variable lead to an implicit convention to local variable #2

Closed
curow opened this issue Feb 20, 2019 · 2 comments

Comments

@curow
Copy link

curow commented Feb 20, 2019

change the 28th line to

global state = sample(1:3,weights(P[state,:]))

will eliminate the UndefVarError: state not defined Error.

This error is due to Julia's Weird Convention for writing to a global variable.
here is a more clear explain at Stack Overflow

@h-Klok
Copy link
Owner

h-Klok commented Feb 24, 2019

Thank you for the find, the codes been fixed :)

@h-Klok h-Klok closed this as completed Feb 24, 2019
@VincentTam
Copy link
Contributor

@h-Klok Just a suggestion. Mentioning the issue (by typing #2) in your Git commit title/message would allow easier tracking.

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