Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMutated Variable #455
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rgrempel
Dec 4, 2015
Contributor
Curious! The Javascript side of the problem is particularly hard to explain ... at first, I thought that it could possibly be a case of number primitive vs. Number object, but the === check rules that out.
You're more likely to get someone to play with this if you post a http://sscce.org -- I tried pasting your stuff into http://elm-lang.org/try for fun, but it's not very self-contained.
|
Curious! The Javascript side of the problem is particularly hard to explain ... at first, I thought that it could possibly be a case of number primitive vs. Number object, but the You're more likely to get someone to play with this if you post a http://sscce.org -- I tried pasting your stuff into http://elm-lang.org/try for fun, but it's not very self-contained. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nomicflux
Dec 4, 2015
I'm working on trying to produce an example which replicates the problem, and a simple example doesn't. If I just create a rectangle, there's no issue, and I'm creating the code for a proprietary concern, so I can't just link to a Github. Since a main point of Elm (and other functional languages) is that values are supposed to be immutable and I only have to think about inputs / outputs, I don't have the faintest clue where to start looking into what may be going wrong to continue the process besides a mess of compiled JavaScript, and I was hoping that someone would have some advice as to where to go to next. As soon as I have a SSCCE (and open source) example to post, I'll post it, but I don't yet and it seems like a serious enough issue to warrant an issue notification.
nomicflux
commented
Dec 4, 2015
|
I'm working on trying to produce an example which replicates the problem, and a simple example doesn't. If I just create a rectangle, there's no issue, and I'm creating the code for a proprietary concern, so I can't just link to a Github. Since a main point of Elm (and other functional languages) is that values are supposed to be immutable and I only have to think about inputs / outputs, I don't have the faintest clue where to start looking into what may be going wrong to continue the process besides a mess of compiled JavaScript, and I was hoping that someone would have some advice as to where to go to next. As soon as I have a SSCCE (and open source) example to post, I'll post it, but I don't yet and it seems like a serious enough issue to warrant an issue notification. |
evancz
added
the
no sscce
label
Dec 27, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
May 11, 2016
Member
If I understand correctly, this is an issue in Graphics.* so I am going to close and ask that it is reopened on evancz/elm-graphics if it is still a problem.
|
If I understand correctly, this is an issue in |
nomicflux commentedDec 3, 2015
I have run across a rather odd case where a named value gives a different result than its explicit numerical value. So in this code:
the Debug message displays 23.55638567754096 for the value of base, but the bars themselves display as about 1px. This occurs whether or not the Debug.log part is included, and even if the name is changed (to, say,
basex), or if thebaseargument is calculated in theletblock instead of passed in. By contrast,gives exactly the correct width.
The problem continues into the Javascript compilation:
The console message is:
"In JS:" 23.55638567754096 23.55638567754096 true trueSo both
base(given as a parameter) andnewBase(assigned directly in the function) are considered fully equivalent. However, when I usebasein the call to$Graphics$Collageat the end of the function, I get the weird 1px rectangles again; when I usenewBase, I get the full-sized rectangles.