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

locking a var twice in interactive mode breaks kOS's dictionary from then on. #15

Closed
Dunbaratu opened this issue Mar 24, 2014 · 1 comment
Milestone

Comments

@Dunbaratu
Copy link
Member

I discovered this when I was trying to print out a lot of stuff to test the problem I was having with a throttle of infinity (which used to work in old versions of kOS and just became a throttle of 1.0 effectively). When trying to diagnose that problem I ended up trying a lot of stuff at the interactive mode terminal that accidentally exposed this other problem:

Examine this output from the interactive terminal:

lock var to 0.5.
print var.
0.5
lock var to 0.4.
The given key was not present in the dictionary.
set var to 0.4.
The given key was not present in the dictionary.
set anotherVar to 5
The given key was not present in the dictionary.
copy testprog from 0.
The given key was not present in the dictionary.

This only happens in interactive mode. Once I try to "lock var to ..." a second time for a var that's been locked already, all statements parsed from then on seem to be broken, for all variables, even new ones, and any statement.

The same problem does not happen when doing it inside a program file. The following program runs just fine:

lock var to 0.5.
print var.
lock var to 0.4.
print var.
lock anotherLock to 5.0.
print anotherLock.
set anotherVar to 6.0.
print anotherVar.

Does this have something to do with the difference between how the parser behaves when it can see the upcoming future statements ahead of time (in a program file) versus when it can't (in interactive mode)?

@marianoapp
Copy link
Contributor

I already know why this happens, but I haven't gotten around to fix it yet.

@erendrake erendrake added this to the v0.12 Release milestone Apr 13, 2014
erendrake pushed a commit that referenced this issue Apr 14, 2015
Pulling development branch updates
erendrake pushed a commit to erendrake/KOS that referenced this issue May 19, 2015
Pulling changes from the main repo
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