JunoLab / Juno.jl

MIT License
144 stars 23 forks source link

Working of loops is strange #608

Open cryogenium opened 3 years ago

cryogenium commented 3 years ago

With this sandbox (hiekkalaatikko in Finnish) code:

module Hiekkalaatikko

"Removed two very big (810 items) dictionaries, which are not used during this test"

Results = Dict{Int64,Float64}(7 => 16.66666666666667,4 => 6.666666666666668, 9 => 6.6666666666666625,10 => 10.000000000000002,2 => 30.000000000000004, 3 => 6.6666666666666465,5 => 30.0,8 => 13.33333333333334, 6 => 26.66666666666666,1 => 23.333333333333332)

for x = 1:3

first_time = true

for y in keys(Results)

   global worst

   if first_time == true

       worst = y

       first_time = false

   elseif Results[y] < Results[worst]

       worst = y

   end

end

println(worst)

end

for x = 1:3

print(x)

end

"Moduulin loppu" end

Result was always same after restarting REPL:

Starting Julia... () | Documentation: https://docs.julialang.org () | () () | | |_ | Type "?" for help, "]?" for Pkg help. | | | | | | |/ ` | | | | || | | | (| | | Version 1.5.0 (2020-08-01) / |_'|||_'_| | Official https://julialang.org/ release |/ | 3 3 3 123 WARNING: replacing module Hiekkalaatikko.

3 3 123 WARNING: replacing module Hiekkalaatikko.

3 3 123

So, at the first time everything worked like it should, then first looping worked only twice and second three times like it should. What is this??

cryogenium commented 3 years ago

Juno Debug Info for previous is here:

Atom:

Version: 1.51.0 Dev Mode: false Official Release: true { "node": "12.0.0", "v8": "7.3.492.27-electron.0", "uv": "1.27.0", "zlib": "1.2.11", "brotli": "1.0.7", "ares": "1.15.0", "modules": "70", "nghttp2": "1.34.0", "napi": "4", "llhttp": "1.1.1", "http_parser": "2.8.0", "openssl": "1.1.0", "icu": "63.1", "unicode": "11.0", "electron": "5.0.13", "chrome": "73.0.3683.121" }

julia-client:

Version: 0.12.5 Config: { "currentVersion": "0.12.5", "firstBoot": false, "juliaPath": "/home/mikko/julia-1.5.0/bin/julia", "uiOptions": { "enableMenu": true, "enableToolBar": true } }

ink:

Version: 0.12.4 Config: undefined

uber-juno:

Version: 0.3.0 Config: { "disable": true }

language-julia:

Version: 0.19.3 Config: undefined

language-weave:not installed

indent-detective:

Version: 0.4.0 Config: undefined

latex-completions:

Version: 0.3.6 Config: undefined

versioninfo():

Julia Version 1.5.0 Commit 96786e22cc (2020-08-01 23:44 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: AMD E-300 APU with Radeon(tm) HD Graphics WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-9.0.1 (ORCJIT, btver1) Environment: JULIA_EDITOR = atom -a JULIA_NUM_THREADS = 2

Status ~/.julia/environments/v1.5/Project.toml [c52e3926] Atom v0.12.21 [682c06a0] JSON v0.21.1 https://github.com/JuliaIO/JSON.jl#master [0f8b85d8] JSON3 v1.1.2 https://github.com/quinnj/JSON3.jl#master [e5e0dc1b] Juno v0.8.3 [99f44e22] MsgPack v1.1.0 [0cf705f9] Redis v0.2.0 https://github.com/JuliaDatabases/Redis.jl#master [cbff2730] Unmarshal v0.4.0 https://github.com/lwabeke/Unmarshal.jl#master