{"action":"created","issue":{"url":"https://api.github.com/repos/anthill/koala/issues/8","repository_url":"https://api.github.com/repos/anthill/koala","labels_url":"https://api.github.com/repos/anthill/koala/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/anthill/koala/issues/8/comments","events_url":"https://api.github.com/repos/anthill/koala/issues/8/events","html_url":"https://github.com/anthill/koala/issues/8","id":151376612,"number":8,"title":"False circular references","user":{"login":"iOiurson","id":8417814,"avatar_url":"https://avatars.githubusercontent.com/u/8417814?v=3","gravatar_id":"","url":"https://api.github.com/users/iOiurson","html_url":"https://github.com/iOiurson","followers_url":"https://api.github.com/users/iOiurson/followers","following_url":"https://api.github.com/users/iOiurson/following{/other_user}","gists_url":"https://api.github.com/users/iOiurson/gists{/gist_id}","starred_url":"https://api.github.com/users/iOiurson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iOiurson/subscriptions","organizations_url":"https://api.github.com/users/iOiurson/orgs","repos_url":"https://api.github.com/users/iOiurson/repos","events_url":"https://api.github.com/users/iOiurson/events{/privacy}","received_events_url":"https://api.github.com/users/iOiurson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-27T12:48:37Z","updated_at":"2016-04-27T12:59:21Z","closed_at":null,"body":"Formulas like:\r\n`=(totalDecom-SUM(INDEX(FA_RecCostsDecom;1;1):INDEX(FA_RecCostsDecom;1;CA_Periods-1)))*Deprec_UOPRates` when calculated on a cell referenced as `FA_RecCostsDecom` trigger infinite loop.\r\n\r\nThis is because currently our koala algorithm reevaluates a range each time it sees it in a formula.\r\nA good way to handle this would be to store Ranges (in a koala sense) in a `Spreadsheet.range_dict` object so that when koala encounters a Range it already knows, it can directly use the values without reevaluating the Range (then avoiding the infinite loop).\r\n\r\n2 problems though:\r\n- this means the way to initialize Ranges must be adjusted so that a Range is created in the dict on the first element inserted (otherwise the previous formula wouldn't work either)\r\n- this might be a lot of effort for a few cases, since this might not happen that many times"},"comment":{"url":"https://api.github.com/repos/anthill/koala/issues/comments/215073960","html_url":"https://github.com/anthill/koala/issues/8#issuecomment-215073960","issue_url":"https://api.github.com/repos/anthill/koala/issues/8","id":215073960,"user":{"login":"SergeBredin","id":11908390,"avatar_url":"https://avatars.githubusercontent.com/u/11908390?v=3","gravatar_id":"","url":"https://api.github.com/users/SergeBredin","html_url":"https://github.com/SergeBredin","followers_url":"https://api.github.com/users/SergeBredin/followers","following_url":"https://api.github.com/users/SergeBredin/following{/other_user}","gists_url":"https://api.github.com/users/SergeBredin/gists{/gist_id}","starred_url":"https://api.github.com/users/SergeBredin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergeBredin/subscriptions","organizations_url":"https://api.github.com/users/SergeBredin/orgs","repos_url":"https://api.github.com/users/SergeBredin/repos","events_url":"https://api.github.com/users/SergeBredin/events{/privacy}","received_events_url":"https://api.github.com/users/SergeBredin/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T12:59:21Z","updated_at":"2016-04-27T12:59:21Z","body":"Sorry, I thought you were speaking about reevaluating each range for each call\n\n> Le 27 avr. 2016 à 14:56, iOiurson <notifications@github.com> a écrit :\n> \n> Imagine the case:\n> In cell A1 you write =A1, koala would compile this into eval_cell('A1'), leading to an infinite loop.\n> Excel prevents this behaviour by displaying a warning, explaing how to treat Circular references.\n> \n> But in our case, this is not a real circular reference, since we call the previous cell in the current range. Still, koala doesn't how to compile this, and will end up looping infinitely.\n> \n> —\n> You are receiving this because you commented.\n> Reply to this email directly or view it on GitHub <https://github.com/anthill/koala/issues/8#issuecomment-215073338>\n\n"}}