Comments (6)
What version of kOS are you on because this {set time to "Time for coffee".}
and this {set constant to lex("pi", 3.5).}
should be throwing a compile time errors.
from kos.
I'm running v1.4.0.0
from kos.
I just realized i had config:clobberbuiltins set to true, so with that off the two points you mentioned no longer hold. The rest still applies though.
from kos.
Good to know I had to ask after the version because we have had a few people who have for one reason or another been on older versions without knowing it and updating fixed the issue.
I was able to reproduce the error on my end though my test cases ended up looking like this:
log "" to "foo.ks".
run foo. { global x is 1. print defined(x). } print defined(x).
and
//used the foo.ks from above
run foo. {print defined(time).} print defined(time).
and
log "global y is 2." to "bar.ks".
run bar. { print defined(y). } print defined(y).
In my tests the log was only run once and restarts occurred between attempts to remove the added global vars.
Both cases ended up printing
false
true
when they should be printing
true
true
I also tested running the tests as files and not commands typed into the terminal and got the expected result.
At a guess this is down to the terminal execution environment is in a strange state after run command and not fully settled until you have a prompt again.
from kos.
Actually even with clobberbuiltins enabled this
run foo. {set time to "Time for coffee".}
print time.
should still not print Time for coffee
but rather some TIMESTAMP(...)
, meaning in this setup it does not clobber locally but rather overrides globally.
So it does behave fundamentally different than without running a program first like
{set time to "Time for tea".}
print time.
which prints TIMESTAMP(...)
as expected.
from kos.
the abnormal behavior in this case
{set time to "Time for tea".}
print time.
is that it prints TIMESTAMP(...)
as the set should be clobbering time in the global scope as without a LOCAL TIME TO ...
the SET
defaults global.
Which some what counterintuitively means that means that
run foo. {set time to "Time for coffee".}
print time.
is behaving correctly and the other case does not. But as both cases involve clobbering built ins the behavior will always be rather abnormal as it was never intended that you could clobber built ins hence the default setting to prevent it.
from kos.
Related Issues (20)
- PIDLoop parameters in SteeringManager:PITCHPID/YAWPID change inconsistently HOT 7
- Update docs "Creating GUIs", examples use gui as a variable HOT 1
- (RP-1 only) probe core is 6x heavier in flight scene than in VAB (disk space mass calculated wrong). HOT 3
- Borken links [DOCUMENTATION]
- Can't set SASMODE... maybe RemoteTech-related
- Stack misalignment bug HOT 3
- Scope seems to be considered differently 'on board' and 'in Archive' HOT 4
- Resizing terminal repeatedly causes a memory leak [BUG]
- Feature Request: "On Script Error" setting on controller part
- Setting part module field value has no effect for some mods
- docs:"make latexpdf" generates only 19 pages (and they are almost empty) HOT 1
- Some system monospace fonts are not recognized by kOS terminal HOT 2
- Redundancy in compiled form of UNTIL
- Changing the active vessel using `kuniverse` from IVA mode will break the internal camera until the next scene change HOT 4
- KOSVesselModule can populate allInstances dictionary with an ID of 0
- KOSVesselModules has a memory leak problem
- Terminal breaks when something is typed that extends beyond the terminal window
- ship:control:mainthrottle doesn't work unless some other raw control is set [BUG]
- Undefined var when checking if the same var is defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kos.