Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

6 hours ago, scorpianz1525 said:

Is it difficult to compile them? Never done it before

3 hours ago, MaxRebo said:

If you never used Visual Studio before than that most likely also means that there is nothing stopping you from using it, so just go grab the most recent version of VS Community and give it a go. In many cases it's as simple as double-clicking the solution file (.sln) and hitting Ctrl+Shif+B.

If you have access to Visual Studio or Mono Develop and know how to use git it shouldn't be that tough.  We tried to document the process of setting up the environment pretty decently.  But that doesn't mean it's full proof.  I mean, I build kOS about 20 times per day, so it's easy for me to gloss over the details.  Check out these links to help out:

https://github.com/KSP-KOS/KOS/blob/develop/CONTRIBUTING.md#setting-up-your-environment

http://www.monodevelop.com/download/

https://www.visualstudio.com/vs/community/

IF I can get some stuff finished up tonight/tomorrow, I really want to get another pre-release out this weekend.  If for no other reason than to let more users than just the devs test out the CommNet before we make a full release.  The good news is that we should have some pretty nice new features to go along with the update, so it will be far better than a simple compatibility update.

Some day I'd really like to get some automated dev builds posted as we merge new pull requests.

Link to comment
Share on other sites

1 minute ago, hvacengi said:

If you have access to Visual Studio or Mono Develop and know how to use git it shouldn't be that tough.  We tried to document the process of setting up the environment pretty decently.  But that doesn't mean it's full proof.  I mean, I build kOS about 20 times per day, so it's easy for me to gloss over the details.  Check out these links to help out:

https://github.com/KSP-KOS/KOS/blob/develop/CONTRIBUTING.md#setting-up-your-environment

http://www.monodevelop.com/download/

https://www.visualstudio.com/vs/community/

IF I can get some stuff finished up tonight/tomorrow, I really want to get another pre-release out this weekend.  If for no other reason than to let more users than just the devs test out the CommNet before we make a full release.  The good news is that we should have some pretty nice new features to go along with the update, so it will be far better than a simple compatibility update.

Some day I'd really like to get some automated dev builds posted as we merge new pull requests.

Cool thanks. I've used Jenkins in the past and it works fairly well to auto build things for you.

Link to comment
Share on other sites

Just now, scorpianz1525 said:

Cool thanks. I've used Jenkins in the past and it works fairly well to auto build things for you.

We use Travis to build automatically.  The trick is posting the builds somewhere that they can accessed by others.  I've been reluctant to suggest getting travis to push as a git release, just because it will bloat the "release" count and the number of tags.  I've never used Jenkins, so I'm not sure what all would be involved.  Some day, when I clone myself...

Link to comment
Share on other sites

So, has anybody found a mechanism to get the Isp and thrust of a RealFuels engine into a script? I wrote my first kOS script (basic maneuver-execution, preceded by a 5-second RCS blast to ensure ullage), and while the top part works for stock engines (or at least mis-configured RF engines), it results in a divide-by-zero error when I try to run it with most RF engines.

Right now, I've got a version that passes in thrust and specific impulse as parameters, but that means I have to look them up.

SET mthr TO 0.
SET ispdiv TO 0.0.
LIST ENGINES IN engList.
FOR eng IN engList {
    IF eng:IGNITION {
        SET modList TO eng:MODULES.
        SET isRF to FALSE.
        FOR modName IN modList {
            if (modName = "ModuleEnginesRF") {
                print "RealFuels engine detected! " + eng:NAME.
                isRF = TRUE.
                return 1.
                break.
            }
        }
        if (! isRF) {
            SET mthr TO mthr + eng:MAXTHRUST.
            SET ispdiv TO ispdiv + (eng:MAXTHRUST / eng:ISP).
            // Divide-by-zero at this line for RF engines.
        }
    }
}

Otherwise, thanks for all the work you guys have put into this. I'll say, though, coming from a background of Java, Bash, and occasional Python and Groovy, the period-terminated statements have thrown me off so many times; I don't have the mental cue of working in an IDE to tell my brain "insert semicolon", not that a semicolon would work anyways, so my brain defaults to "writing script; therefore statements terminated on newline".

Also: is there a general style guide for kOS scripts? I've tried to default to having most kOS syntax be capitalized, and most of my variable names in camelcase, but I've been inconsistent.

Edited by Starman4308
Link to comment
Share on other sites

2 hours ago, Starman4308 said:

So, has anybody found a mechanism to get the Isp and thrust of a RealFuels engine into a script? I wrote my first kOS script (basic maneuver-execution, preceded by a 5-second RCS blast to ensure ullage), and while the top part works for stock engines (or at least mis-configured RF engines), it results in a divide-by-zero error when I try to run it with most RF engines.

Right now, I've got a version that passes in thrust and specific impulse as parameters, but that means I have to look them up.

[... snip ...]

Also: is there a general style guide for kOS scripts? I've tried to default to having most kOS syntax be capitalized, and most of my variable names in camelcase, but I've been inconsistent.

My guess is that the ModuleEnginesRF doesn't do ISP the same way, probably because they use a different solver.  Could you post an issue to github so we remember to work on it?  I don't know when we'll get to it, but we'll try to do so.

There isn't really much of a style guide.  I try to maintain my C# style for kerboscript as much as possible, just because it's how I'm used to naming variables.  But we have users from all kinds of language backgrounds, and I've seen any number of styles used.  If you look at my earliest scripts I didn't even bother with camelcase, but as I've written more complicated scripts I've found camelcase really helps with the variable readability.  The docs mostly use the capitalized, and I've tried to stay consistent there.  But I honestly hate the idea of writing scripts in all caps, it is incredibly painful to read.  I'd rather everything was lower case (which is in fact how my early scripts were written) if for no better reason than I don't have to use the caps-lock key (I use that too much already working on building blueprints).

Link to comment
Share on other sites

12 minutes ago, hvacengi said:

My guess is that the ModuleEnginesRF doesn't do ISP the same way, probably because they use a different solver.  Could you post an issue to github so we remember to work on it?  I don't know when we'll get to it, but we'll try to do so.

There isn't really much of a style guide.  I try to maintain my C# style for kerboscript as much as possible, just because it's how I'm used to naming variables.  But we have users from all kinds of language backgrounds, and I've seen any number of styles used.  If you look at my earliest scripts I didn't even bother with camelcase, but as I've written more complicated scripts I've found camelcase really helps with the variable readability.  The docs mostly use the capitalized, and I've tried to stay consistent there.  But I honestly hate the idea of writing scripts in all caps, it is incredibly painful to read.  I'd rather everything was lower case (which is in fact how my early scripts were written) if for no better reason than I don't have to use the caps-lock key (I use that too much already working on building blueprints).

I am reminded of how much I hate GitHub; one of the terms of service is "only one account per person", and I prefer to keep professional and personal endeavors separate. I apologize, but posting to Github is something I won't do for KSP, for that reason.

Otherwise; yeah, probably that RealFuels isn't using the stock engine module. My best guess is that it stores the engine config, and then looks up the Isp and thrust as needed from the part's config list.

Link to comment
Share on other sites

11 hours ago, Starman4308 said:

I am reminded of how much I hate GitHub; one of the terms of service is "only one account per person", and I prefer to keep professional and personal endeavors separate. I apologize, but posting to Github is something I won't do for KSP, for that reason.

I filed an issue: https://github.com/KSP-KOS/KOS/issues/1861

Link to comment
Share on other sites

Just finally found the 1.2 prerelease and while I may or may not have spelled it correctly I will be downloading it to install bugs or not. Because I have been waiting for it and the bugs just add flavor. Keep up the good work!

Link to comment
Share on other sites

v1.0.2-pre-2 Pre-release

for KSP v1.2.1 Downloads this release

Pre-release version of the build with KSP 1.2.1 compatibility.

Download:

Github: https://github.com/KSP-KOS/KOS/releases/tag/v1.0.2-pre-2

WARNING - May contain multiple bugs. Please report any issues you find!

Sub-warning: this update attempts to include unified support for CommNet and RemoteTech, but we need your help in thuroughly testing these features. Please try to test (break) these features so we can ensure that we squash as many bugs as possible before full release.

Update to the previous pre-release including:

  • Fix Sphinx doc builds on Python 3 and new versions of Sphinx
  • Settings are now stored in the KSP difficulty settings window documentation
  • Fix issue when mods are installed that use dynamic modules (like ContractConfigurator)
  • Added Trajectories API documentation
  • Fix issue reading from 4 byte files stored on the local hard drive which would erase the entire hard drive
  • KSM files are now stored using GZIP compression to reduce file size (while this change should be backwards compatibile, the kOS team always recommends recompiling ksm files whenever updating versions)
  • Support for CommNet and RemoteTech documentation
Edited by hvacengi
Link to comment
Share on other sites

Another small issue, my best guess is that is related with blizzy's toolbar. I got this in log file:

Spoiler


Exception handling event onGUIApplicationLauncherReady in class KOSToolbarWindow:System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[kOS.Suffixed.Config+PropId,kOS.Safe.Encapsulation.Suffixes.ConfigKey].get_Item (PropId key) [0x00000] in <filename unknown>:0
  at kOS.Suffixed.Config.GetPropValue[Boolean] (PropId id) [0x00000] in <filename unknown>:0
  at kOS.Suffixed.Config.get_UseBlizzyToolbarOnly () [0x00000] in <filename unknown>:0
  at kOS.Screen.KOSToolbarWindow.AddButton () [0x00000] in <filename unknown>:0
  at EventVoid.Fire () [0x00000] in <filename unknown>:0
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[kOS.Suffixed.Config+PropId,kOS.Safe.Encapsulation.Suffixes.ConfigKey].get_Item (PropId key) [0x00000] in <filename unknown>:0
  at kOS.Suffixed.Config.GetPropValue[Boolean] (PropId id) [0x00000] in <filename unknown>:0
  at kOS.Suffixed.Config.get_UseBlizzyToolbarOnly () [0x00000] in <filename unknown>:0
  at kOS.Screen.KOSToolbarWindow.AddButton () [0x00000] in <filename unknown>:0
  at EventVoid.Fire () [0x00000] in <filename unknown>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

Let me know if you need full log file. I guess the problem is with early career game and fresh install of various mods.
Since, I don't have any of kOS part unlocked, I can't define buttons on toolbar properly. Therefore, kOS can't find any and I belive it throws those exceptions in log.

Don't know if you already aware or not, but you need to update toolbar wraper. Small piece of code that need to be added in all mods using toolbar. That is due to KSP 1.2.x update and in combination with CC that exposed some nasty bug if used with mods that didn't updated their code. More info is in toolbar thread, I just mention it in case that you are not aware of it.

Link to comment
Share on other sites

On 11/13/2016 at 5:03 AM, kcs123 said:

Another small issue, my best guess is that is related with blizzy's toolbar. I got this in log file:

That's odd.  For some reason something is still looking for the blizzy setting in the config file instead of the new difficulty settings.  I'll track it down.

On 11/13/2016 at 5:03 AM, kcs123 said:

Don't know if you already aware or not, but you need to update toolbar wraper. Small piece of code that need to be added in all mods using toolbar. That is due to KSP 1.2.x update and in combination with CC that exposed some nasty bug if used with mods that didn't updated their code. More info is in toolbar thread, I just mention it in case that you are not aware of it.

Already taken care of

On 11/11/2016 at 9:29 AM, hvacengi said:

Fix issue when mods are installed that use dynamic modules (like ContractConfigurator)

We actually had to fix that issue in multiple locations (two of our addons used similar code).

Edited by hvacengi
Link to comment
Share on other sites

1 hour ago, hvacengi said:

That's odd.  For some reason something is still looking for the blizzy setting in the config file instead of the new difficulty settings.  I'll track it down.

Don't know if it is of any help, but kOS icon also missing in main game toolbar.

Another odd thing is in SPH/VAB. That one is be related with beta IR mod. Migth be strange interaction between toolbar-kOS-IR mod.

Fresh install, blizzy toolbar is empty, but shown on UI, so you can choose size/positon and icons you want to be there.
If I add only IR icon on it, toolbar itself become invisible. If you leave it like that, there is no chance to configure it properly again except by deleting toolbar-settings.dat file located in "GameData" root folder.

Workaround from this, at least in my case is to put final frontier icon, so it can stay visible even when you click on "broken" icon from other mods like IR. Someone mentioned that I need to edit IR xml config file to suport toolbar, have yet to investigate that option.

 

Somehow I missed info about kOS options being in difficulty settings UI. Have to check those if I can make kOS UI apear on regular toolbar at least.

Link to comment
Share on other sites

11 minutes ago, kcs123 said:

Don't know if it is of any help, but kOS icon also missing in main game toolbar.

Since the error happens when setting up the toolbar, yes the regular button is likely to break too.  The fix would be to remove blizzy's toolbar for the time being, because the issue only occurs when it detects that the toolbar is actually installed.  Either that or change line 30 of "src/kOS/Suffixed/Config.cs" to read the following, and recompile it locally:

public bool UseBlizzyToolbarOnly { get { return kOSCustomParameters.Instance.useBlizzyToolbarOnly; } set { kOSCustomParameters.Instance.useBlizzyToolbarOnly = value; } }

We'll get the fix into the next version of kOS, but I don't intend to do another pre-release unless there's a major revision required to a core feature.

Issue opened: https://github.com/KSP-KOS/KOS/issues/1863

Edited by hvacengi
Link to comment
Share on other sites

1 minute ago, hvacengi said:

We'll get the fix into the next version of kOS, but I don't intend to do another pre-release unless there's a major revision required to a core feature.

No worries, I will make some workaround with this. Take you time and schedule fix along with other bugs, no special need to make another pre-release for it. Some other player could read about it here and avoid issue. Not a big deal, clicking on part and on button to show terminal still works properly.

Link to comment
Share on other sites

Are you not supposed to programmatically alter the settable fields of a maneuver node that's already been added? Doing so apparently successfully alters the node in the desired way, but immediately after an "Object reference not set to an instance of an object" error is thrown. To reproduce, just manually create a maneuver node and run a simple srcipt that does something like "SET NEXTNODE:ETA TO 600.". Or just type it into the terminal, it causes the error in the terminal environment as well. Even if for some reason the NEXTNODE variable is actually supposed to be read-only, writing to an added node via previously stored reference (like so: "SET nd TO NODE(TIME:SECONDS+300,1,1,1). ADD nd. SET nd:ETA TO 600.") also produces the error. It was like this at least since the earlier v1.0.2 pre-1

This is driving me crazy, and if I at least knew if it's something you just shouldn't do then I could move on and try a different approach.

Link to comment
Share on other sites

2 hours ago, MaxRebo said:

Are you not supposed to programmatically alter the settable fields of a maneuver node that's already been added? Doing so apparently successfully alters the node in the desired way, but immediately after an "Object reference not set to an instance of an object" error is thrown. To reproduce, just manually create a maneuver node and run a simple srcipt that does something like "SET NEXTNODE:ETA TO 600.". Or just type it into the terminal, it causes the error in the terminal environment as well. Even if for some reason the NEXTNODE variable is actually supposed to be read-only, writing to an added node via previously stored reference (like so: "SET nd TO NODE(TIME:SECONDS+300,1,1,1). ADD nd. SET nd:ETA TO 600.") also produces the error. It was like this at least since the earlier v1.0.2 pre-1

This is driving me crazy, and if I at least knew if it's something you just shouldn't do then I could move on and try a different approach.

I think that users of previous versions have reported that modifying the node's suffixes worked.  I'll see if I can reproduce the bug tomorrow evening.  Can you share a log file containing the error, it should help us track down the issue.  If I were to guess, it means we aren't telling KSP's patched conics solver to correctly update the flight plan, but I'm not sure.  If I can see your log before I start working on it, it might point me closer to the right direction.

A potential work around might be to remove the node, wait one physics tick, and then edit the node, wait another tick, and re-add the node.  It might also be that you need to add a wait in between the steps you're already doing.  I've found that KSP is picky about how you edit a node.  For instance if you add a node in the same tick as switching the map view things go funny.  If it turns out to be something like this, we may just want to force any node addition to wait for the next physics tick.

Edited by hvacengi
Link to comment
Share on other sites

2 hours ago, hvacengi said:

I think that users of previous versions have reported that modifying the node's suffixes worked.

It was working for me fine in version 1.0 under ksp 1.1.3 things like:

Quote

DECLARE FUNCTION mvVecNode {
    DECLARE PARAMETER n. // target node
    DECLARE PARAMETER v. // vector to apply
    SET n:RADIALOUT to v:X.
    SET n:NORMAL to v:Y.
    SET n:PROGRADE to v:Z.
}.

and

Set sNode:ETA to (sNode:ETA - 1 + actualInterBurn + slewSecs).

worked fine - it would be a shame if that functionality went away. I did have to put some WAIT 0 after messing with the nodes - but I forget why (it's somewhere in this thread).

Link to comment
Share on other sites

7 hours ago, hvacengi said:

A potential work around might be to remove the node, wait one physics tick, and then edit the node, wait another tick, and re-add the node.

Yeah, that's how I'm working around this problem right now. It's really ugly though.

7 hours ago, hvacengi said:

It might also be that you need to add a wait in between the steps you're already doing.

Nope, doesn't help at all unfortunately.

Here's where kOS complains. Strange though that setmember does seem to do its work, apart from throwing an error afterwards.

Spoiler

[LOG 13:05:05.571] kOS: Pushing context staring with: File                 Line:Col IP   label   opcode operand
[LOG 13:05:05.572] kOS: Saving and removing 0 pointers
[LOG 13:05:05.592] kOS: At 1:/mvrtest, line 3
SET nd:ETA TO 600.
              ^

[LOG 13:05:05.594] System.NullReferenceException: Object reference not set to an instance of an object
  at ManeuverNode.OnGizmoUpdated (Vector3d dV, Double ut) [0x00000] in <filename unknown>:0 
  at kOS.Suffixed.Node.ToNodeRef () [0x00000] in <filename unknown>:0 
  at kOS.Suffixed.Node.<InitializeSuffixes>b__12_1 (kOS.Safe.Encapsulation.ScalarValue value) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Encapsulation.Suffixes.SetSuffix`1[kOS.Safe.Encapsulation.ScalarValue].Set (System.Object value) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Encapsulation.Structure.ProcessSetSuffix (IDictionary`2 suffixes, System.String suffixName, System.Object value) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Encapsulation.Structure.SetSuffix (System.String suffixName, System.Object value) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Compilation.OpcodeSetMember.Execute (ICpu cpu) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Execution.CPU.ExecuteInstruction (IProgramContext context, Boolean doProfiling) [0x00000] in <filename unknown>:0 
[LOG 13:05:05.599] Code Fragment
File                 Line:Col IP   label   opcode operand
====                 ====:=== ==== ================================  
                        0:0   0000         jump +27 
[built-in]              0:0   0001 @LR00   pushscope -999 0 
[built-in]              0:0   0002 @LR01   push $runonce 
[built-in]              0:0   0003 @LR02   swap 
[built-in]              0:0   0004 @LR03   storelocal 
[built-in]              0:0   0005 @LR04   push $filename 
[built-in]              0:0   0006 @LR05   swap 
[built-in]              0:0   0007 @LR06   storelocal 
[built-in]              0:0   0008 @LR07   push _KOSArgMarker_ 
[built-in]              0:0   0009 @LR08   push $filename 
[built-in]              0:0   0010 @LR09   eval 
[built-in]              0:0   0011 @LR10   push True 
[built-in]              0:0   0012 @LR11   push null 
[built-in]              0:0   0013 @LR12   call load() 
[built-in]              0:0   0014 @LR13   br.false +6 
[built-in]              0:0   0015 @LR14   push $runonce 
[built-in]              0:0   0016 @LR15   br.false +4 
[built-in]              0:0   0017 @LR16   pop 
[built-in]              0:0   0018 @LR17   push 0 
[built-in]              0:0   0019 @LR18   return 1 deep 
[built-in]              0:0   0020 @LR19   push $entrypoint 
[built-in]              0:0   0021 @LR20   swap 
[built-in]              0:0   0022 @LR21   storelocal 
[built-in]              0:0   0023 @LR22   call $entrypoint 
[built-in]              0:0   0024 @LR23   pop 
[built-in]              0:0   0025 @LR24   push 0 
[built-in]              0:0   0026 @LR25   return 1 deep 
1:/mvrtest              1:1   0027 @0001   argbottom 
1:/mvrtest              1:5   0028 @0002   push $nd 
1:/mvrtest              1:15  0029 @0003   push _KOSArgMarker_ 
1:/mvrtest              1:16  0030 @0004   push $time 
1:/mvrtest              1:21  0031 @0005   push seconds 
1:/mvrtest              1:21  0032 @0006   getmember 
1:/mvrtest              1:29  0033 @0007   push 300 
1:/mvrtest              1:28  0034 @0008   add 
1:/mvrtest              1:33  0035 @0009   push 1 
1:/mvrtest              1:35  0036 @0010   push 1 
1:/mvrtest              1:37  0037 @0011   push 1 
1:/mvrtest              1:37  0038 @0012   call node() 
1:/mvrtest              1:37  0039 @0013   store 
1:/mvrtest              2:1   0040 @0014   push _KOSArgMarker_ 
1:/mvrtest              2:5   0041 @0015   push $nd 
1:/mvrtest              2:5   0042 @0016   call add() 
1:/mvrtest              2:5   0043 @0017   pop 
1:/mvrtest              3:5   0044 @0018   push $nd 
1:/mvrtest              3:8   0045 @0019   push eta 
1:/mvrtest              3:15  0046 @0020   push 600 
1:/mvrtest              3:15  0047 @0021   setmember <<--INSTRUCTION POINTER--
                        0:0   0048         pop 
                        0:0   0049         EOP 

[LOG 13:05:05.604] kOS: Stack dump: stackPointer = 1
001 SP-> _KOSArgMarker_ (type: KOSArgMarkerType)
000      0 (type: Int32)

[LOG 13:05:05.605] kOS: Popping context 2
[LOG 13:05:05.605] kOS: Removed Context File                 Line:Col IP   label   opcode operand
[LOG 13:05:05.606] kOS: Deleting 0 pointers and restoring 0 pointers
[LOG 13:05:05.606] kOS: New current context File                 Line:Col IP   label   opcode operand

 

The full log (sorry, I don't have an output_log.txt anywhere): KSP.log

Also, the save file I used to create it: kOS.zip
(go to the tracking station and switch to the (only) flight "kOS Mvr Test". Run the script mvrtest.ks on its CPU volume.

I really hope this can be resolved... happy hunting

Edited by MaxRebo
Link to comment
Share on other sites

5 hours ago, MaxRebo said:

I really hope this can be resolved... happy hunting

Well I suspect I've found it.  In KSP 1.1.3 the OnGizmoUpdated method didn't reference the "gizmo" UI element, but in KSP 1.2.x it does.  This is an issue because that UI element only exists when you click on the node to display the edit handles.  This is a bit of a pain, because it means that kOS is going to need to replicate the stock logic instead of calling the stock method, so that we can add a check to see if the underlying node has a gizmo attached.  The issue should exist for all of the settable suffixes.  Because "removing" the node removes the reference to the underlying KSP node, we bypass that section of code.

If you have a github account and could post the issue there, that would be great.  Otherwise I should be able to post it later tonight, along with a fix.

Edited by hvacengi
Link to comment
Share on other sites

@hvacengi I don't have a github account, but I was planning to create one anyway, so I might as well do that now (will file the issues ASAP).
For now, I found another one, and this one seems just as nasty, but at least I think there's next to zero possibility that it depends on internal KSP behavior in any way:

Running a pre-compiled script sometimes breaks the VM during relabeling if the compiled script requires some non-trivial scoping. Running the script's source .ks file does not exhibit this behavior. The error in question goes like this:

Cannot add label throttle`0-2f3c6c7a, label already exists.  Opcode: pushscope 16 15

Consider the following example:

foo.ks

Spoiler

// Library management
GLOBAL libName IS 0. GLOBAL importedLibs IS LEXICON().
FUNCTION import {
	PARAMETER _lib.

	IF NOT importedLibs:HASKEY(_lib) {
		SET libName TO _lib.
		RUNPATH(_lib).
		SET libName TO 0.
	}
	RETURN importedLibs[_lib].
}
FUNCTION export {
	PARAMETER stuff.

	IF libName=0 CannotExport().
	SET importedLibs[libName] TO stuff.
}

// Other functions
GLOBAL someDelegateWithIf IS {IF true SET something TO 0.}.
FUNCTION simpleGlobalFunc1 {}
FUNCTION simpleGlobalFunc2 {}
FUNCTION complexGlobalFunc1 {IF true {}}
FUNCTION complexGlobalFunc2 {IF true {}}
FUNCTION complexGlobalFunc3 {IF true {}}
FUNCTION complexGlobalFunc4 {IF true {}}
FUNCTION someFuncLockingThrottle {LOCK THROTTLE TO 0.}

// Works
SET bar_uncompiled TO import("bar_src").
bar_uncompiled["bar"](). PRINT "---------". PRINT " ".

// Fails with bizarre error
COMPILE "bar_src.ks" TO "bar.ksm".
SET bar_compiled TO import("bar").
// ^ just saying "RUN bar.ksm." would have resulted in the same
//   error, but I'm still using import() here for context
bar_compiled["bar"](). // <-- Never reaches this point

 

bar_src.ks

Spoiler

{
	// Private namespace
	FUNCTION simpleFunc1 {}
	FUNCTION simpleFunc2 {}
	FUNCTION simpleFunc3 {}
	FUNCTION complexFunc1 {LIST PARTS IN ps. FOR _p IN ps {IF true {}}}
	FUNCTION complexFunc2 {IF true {LOCK THROTTLE TO 0.} .}
	FUNCTION complexFunc3 {IF true {LOCK THROTTLE TO 0.} IF true {LOCK THROTTLE TO 0.} RETURN 5.
	}
	// Library exports
	export(LEXICON(
		"bar", {PRINT "Bar!!!".}
	)).
}

 

Load this save and switch to the vessel "kOS Tester" from the tracking station. On that vessel, RUN foo.
I apologize if that "minimal" example makes little sense or seems totally arbitrary, but I reached the point where further minimizing all those functions that never even get called would make the error disappear.

This might seem like a total fringe case but I need to run pre-compiled scripts this way in order to make my framework fit on a single CPU volume. And yes, I already ensured maximal code reuse / minimal code redundancy and even plaintext-minimized the scripts to utter unintelligibility...

The complete error from KSP.log (full log here):

Spoiler

[LOG 19:33:07.993] kOS: Pushing context staring with: File                 Line:Col IP   label   opcode operand
[LOG 19:33:07.994] kOS: Saving and removing 0 pointers
[ERR 19:33:08.142] kOS: =====Relabeled Program so far is: =========

[ERR 19:33:08.195] kOS: File                 Line:Col IP   Label   opcode operand Destination
----                 ----:--- ---- ------- ---------------------  
$$empty$$:/             0:0   0000  jump +0 DEST: @0107 
[built-in]              0:0   0001 @LR00 pushscope -999 0 DEST: null 
[built-in]              0:0   0002 @LR01 push $runonce DEST: null 
[built-in]              0:0   0003 @LR02 swap DEST: null 
[built-in]              0:0   0004 @LR03 storelocal DEST: null 
[built-in]              0:0   0005 @LR04 push $filename DEST: null 
[built-in]              0:0   0006 @LR05 swap DEST: null 
[built-in]              0:0   0007 @LR06 storelocal DEST: null 
[built-in]              0:0   0008 @LR07 push _KOSArgMarker_ DEST: null 
[built-in]              0:0   0009 @LR08 push $filename DEST: null 
[built-in]              0:0   0010 @LR09 eval DEST: null 
[built-in]              0:0   0011 @LR10 push True DEST: null 
[built-in]              0:0   0012 @LR11 push null DEST: null 
[built-in]              0:0   0013 @LR12 call load() DEST: null 
[built-in]              0:0   0014 @LR13 br.false +0 DEST: @LR19 
[built-in]              0:0   0015 @LR14 push $runonce DEST: null 
[built-in]              0:0   0016 @LR15 br.false +0 DEST: @LR19 
[built-in]              0:0   0017 @LR16 pop DEST: null 
[built-in]              0:0   0018 @LR17 push 0 DEST: null 
[built-in]              0:0   0019 @LR18 return 1 deep DEST: null 
[built-in]              0:0   0020 @LR19 push $entrypoint DEST: null 
[built-in]              0:0   0021 @LR20 swap DEST: null 
[built-in]              0:0   0022 @LR21 storelocal DEST: null 
[built-in]              0:0   0023 @LR22 call $entrypoint DEST: null 
[built-in]              0:0   0024 @LR23 pop DEST: null 
[built-in]              0:0   0025 @LR24 push 0 DEST: null 
[built-in]              0:0   0026 @LR25 return 1 deep DEST: null 
1:/foo                  4:17  0027 import`0-6a914a99 pushscope 1 0 DEST:  
1:/foo                  5:12  0028 @0008 push _lib DEST:  
1:/foo                  5:12  0029 @0009 swap DEST:  
1:/foo                  5:12  0030 @0010 storelocal DEST:  
1:/foo                  5:12  0031 @0011 argbottom DEST:  
1:/foo                  7:9   0032 @0012 push $importedlibs DEST:  
1:/foo                  7:22  0033 @0013 push haskey DEST:  
1:/foo                  7:22  0034 @0014 getmethod DEST:  
1:/foo                  7:28  0035 @0015 push _KOSArgMarker_ DEST:  
1:/foo                  7:29  0036 @0016 push $_lib DEST:  
1:/foo                  7:29  0037 @0017 call <indirect> DEST:  
1:/foo                  7:29  0038 @0018 not DEST:  
1:/foo                  7:29  0039 @0019 br.false +16 DEST: @0035 
1:/foo                  7:35  0040 @0020 pushscope 2 1 DEST:  
1:/foo                  8:7   0041 @0021 push $libname DEST:  
1:/foo                  8:18  0042 @0022 push $_lib DEST:  
1:/foo                  8:18  0043 @0023 store DEST:  
1:/foo                  9:3   0044 @0024 push _KOSArgMarker_ DEST:  
1:/foo                  9:3   0045 @0025 push _KOSArgMarker_ DEST:  
1:/foo                  9:3   0046 @0026 push False DEST:  
1:/foo                  9:11  0047 @0027 push $_lib DEST:  
1:/foo                  9:11  0048 @0028 eval DEST:  
1:/foo                  9:11  0049 @0029 call 1 DEST: @LR00 
1:/foo                  9:11  0050 @0030 pop DEST:  
1:/foo                 10:7   0051 @0031 push $libname DEST:  
1:/foo                 10:18  0052 @0032 push 0 DEST:  
1:/foo                 10:18  0053 @0033 store DEST:  
1:/foo                 11:2   0054 @0034 popscope 1 DEST:  
1:/foo                 12:9   0055 @0035 push $importedlibs DEST:  
1:/foo                 12:22  0056 @0036 push $_lib DEST:  
1:/foo                 12:22  0057 @0037 getindex DEST:  
1:/foo                 12:22  0058 @0038 return 1 deep DEST:  
1:/foo                 13:1   0059 @0039 popscope 1 DEST:  
1:/foo                 13:1   0060 @0040 push 0 DEST:  
1:/foo                 13:1   0061 @0041 return 0 deep DEST:  
1:/foo                 14:17  0062 export`0-972f9a53 pushscope 3 0 DEST:  
1:/foo                 15:12  0063 @0043 push stuff DEST:  
1:/foo                 15:12  0064 @0044 swap DEST:  
1:/foo                 15:12  0065 @0045 storelocal DEST:  
1:/foo                 15:12  0066 @0046 argbottom DEST:  
1:/foo                 17:5   0067 @0047 push $libname DEST:  
1:/foo                 17:13  0068 @0048 push 0 DEST:  
1:/foo                 17:12  0069 @0049 eq DEST:  
1:/foo                 17:12  0070 @0050 br.false +4 DEST: @0054 
1:/foo                 17:27  0071 @0051 push _KOSArgMarker_ DEST:  
1:/foo                 17:27  0072 @0052 call cannotexport DEST:  
1:/foo                 17:27  0073 @0053 pop DEST:  
1:/foo                 18:6   0074 @0054 push $importedlibs DEST:  
1:/foo                 18:19  0075 @0055 push $libname DEST:  
1:/foo                 18:31  0076 @0056 push $stuff DEST:  
1:/foo                 18:31  0077 @0057 setindex DEST:  
1:/foo                 19:1   0078 @0058 popscope 1 DEST:  
1:/foo                 19:1   0079 @0059 push 0 DEST:  
1:/foo                 19:1   0080 @0060 return 0 deep DEST:  
1:/foo                 23:28  0081 simpleglobalfunc1`0-7d4cca63 pushscope 5 0 DEST:  
1:/foo                 23:28  0082 @0062 argbottom DEST:  
1:/foo                 23:29  0083 @0063 popscope 1 DEST:  
1:/foo                 23:29  0084 @0064 push 0 DEST:  
1:/foo                 23:29  0085 @0065 return 0 deep DEST:  
1:/foo                 24:28  0086 simpleglobalfunc2`0-7f01a302 pushscope 6 0 DEST:  
1:/foo                 24:28  0087 @0067 argbottom DEST:  
1:/foo                 24:29  0088 @0068 popscope 1 DEST:  
1:/foo                 24:29  0089 @0069 push 0 DEST:  
1:/foo                 24:29  0090 @0070 return 0 deep DEST:  
1:/foo                 25:29  0091 complexglobalfunc1`0-b0de7449 pushscope 7 0 DEST:  
1:/foo                 25:29  0092 @0072 argbottom DEST:  
1:/foo                 25:33  0093 @0073 push True DEST:  
1:/foo                 25:33  0094 @0074 br.false +3 DEST: @0077 
1:/foo                 25:38  0095 @0075 pushscope 8 7 DEST:  
1:/foo                 25:39  0096 @0076 popscope 1 DEST:  
1:/foo                 25:40  0097 @0077 popscope 1 DEST:  
1:/foo                 25:40  0098 @0078 push 0 DEST:  
1:/foo                 25:40  0099 @0079 return 0 deep DEST:  
1:/foo                 26:29  0100 complexglobalfunc2`0-ac8dec4b pushscope 9 0 DEST:  
1:/foo                 26:29  0101 @0081 argbottom DEST:  
1:/foo                 26:33  0102 @0082 push True DEST:  
1:/foo                 26:33  0103 @0083 br.false +3 DEST: @0086 
1:/foo                 26:38  0104 @0084 pushscope 10 9 DEST:  
1:/foo                 26:39  0105 @0085 popscope 1 DEST:  
1:/foo                 26:40  0106 @0086 popscope 1 DEST:  
1:/foo                 26:40  0107 @0087 push 0 DEST:  
1:/foo                 26:40  0108 @0088 return 0 deep DEST:  
1:/foo                 27:29  0109 complexglobalfunc3`0-6d4cc034 pushscope 11 0 DEST:  
1:/foo                 27:29  0110 @0090 argbottom DEST:  
1:/foo                 27:33  0111 @0091 push True DEST:  
1:/foo                 27:33  0112 @0092 br.false +3 DEST: @0095 
1:/foo                 27:38  0113 @0093 pushscope 12 11 DEST:  
1:/foo                 27:39  0114 @0094 popscope 1 DEST:  
1:/foo                 27:40  0115 @0095 popscope 1 DEST:  
1:/foo                 27:40  0116 @0096 push 0 DEST:  
1:/foo                 27:40  0117 @0097 return 0 deep DEST:  
1:/foo                 28:29  0118 complexglobalfunc4`0-68fc3836 pushscope 13 0 DEST:  
1:/foo                 28:29  0119 @0099 argbottom DEST:  
1:/foo                 28:33  0120 @0100 push True DEST:  
1:/foo                 28:33  0121 @0101 br.false +3 DEST: @0104 
1:/foo                 28:38  0122 @0102 pushscope 14 13 DEST:  
1:/foo                 28:39  0123 @0103 popscope 1 DEST:  
1:/foo                 28:40  0124 @0104 popscope 1 DEST:  
1:/foo                 28:40  0125 @0105 push 0 DEST:  
1:/foo                 28:40  0126 @0106 return 0 deep DEST:  
1:/foo                 29:35  0127 throttle`0-2f3c6c7a pushscope 16 15 DEST:  
1:/foo                 29:35  0128 @0117 argbottom DEST:  
1:/foo                 29:52  0129 @0118 push 0 DEST:  
1:/foo                 29:52  0130 @0119 return 1 deep DEST:  
1:/foo                 29:35  0131 throttle`0-default argbottom DEST:  
1:/foo                 29:35  0132 @0114 push $throttle DEST:  
1:/foo                 29:35  0133 @0115 return 0 deep DEST:  
1:/foo                 29:34  0134 somefunclockingthrottle`0-e9b24317 pushscope 15 0 DEST:  
1:/foo                 29:34  0135 @0121 argbottom DEST:  
1:/foo                 29:35  0136 @0122 push $throttle* DEST:  
1:/foo                 29:35  0137 @0123 PushDelegateRelocateLater Dest{throttle`0-2f3c6c7a} DEST: throttle`0-2f3c6c7a 
1:/foo                 29:35  0138 @0124 storeglobal DEST:  
1:/foo                 29:35  0139 @0125 PushRelocateLater Dest{@0001} DEST: @0001 
1:/foo                 29:35  0140 @0126 addtrigger DEST:  
1:/foo                 29:35  0141 @0127 push _KOSArgMarker_ DEST:  
1:/foo                 29:35  0142 @0128 push throttle DEST:  
1:/foo                 29:35  0143 @0129 push True DEST:  
1:/foo                 29:35  0144 @0130 call toggleflybywire() DEST:  
1:/foo                 29:35  0145 @0131 pop DEST:  
1:/foo                 29:54  0146 @0132 popscope 1 DEST:  
1:/foo                 29:54  0147 @0133 push 0 DEST:  
1:/foo                 29:54  0148 @0134 return 0 deep DEST:  
1:/foo                 -1:0   0149 @0001 push $throttle DEST:  
1:/foo                 -1:0   0150 @0002 push _KOSArgMarker_ DEST:  
1:/foo                 -1:0   0151 @0003 call $throttle* DEST:  
1:/foo                 -1:0   0152 @0004 storeglobal DEST:  
1:/foo                 -1:0   0153 @0005 push True DEST:  
1:/foo                 -1:0   0154 @0006 return 0 deep DEST:  
1:/foo                 29:35  0155 @0107 push $throttle* DEST:  
1:/foo                 29:35  0156 @0108 exists DEST:  
1:/foo                 29:35  0157 @0109 br.true +4 DEST:  
1:/foo                 29:35  0158 @0110 push $throttle* DEST:  
1:/foo                 29:35  0159 @0111 PushRelocateLater Dest{throttle`0-default} DEST: throttle`0-default 
1:/foo                 29:35  0160 @0112 store DEST:  
1:/foo                  3:1   0161 @0135 push $import* DEST:  
1:/foo                  3:1   0162 @0136 PushDelegateRelocateLater Dest{import`0-6a914a99} DEST: import`0-6a914a99 
1:/foo                  3:1   0163 @0137 store DEST:  
1:/foo                  3:1   0164 @0138 push $export* DEST:  
1:/foo                  3:1   0165 @0139 PushDelegateRelocateLater Dest{export`0-972f9a53} DEST: export`0-972f9a53 
1:/foo                  3:1   0166 @0140 store DEST:  
1:/foo                  3:1   0167 @0141 push $simpleglobalfunc1* DEST:  
1:/foo                  3:1   0168 @0142 PushDelegateRelocateLater Dest{simpleglobalfunc1`0-7d4cca63} DEST: simpleglobalfunc1`0-7d4cca63 
1:/foo                  3:1   0169 @0143 store DEST:  
1:/foo                  3:1   0170 @0144 push $simpleglobalfunc2* DEST:  
1:/foo                  3:1   0171 @0145 PushDelegateRelocateLater Dest{simpleglobalfunc2`0-7f01a302} DEST: simpleglobalfunc2`0-7f01a302 
1:/foo                  3:1   0172 @0146 store DEST:  
1:/foo                  3:1   0173 @0147 push $complexglobalfunc1* DEST:  
1:/foo                  3:1   0174 @0148 PushDelegateRelocateLater Dest{complexglobalfunc1`0-b0de7449} DEST: complexglobalfunc1`0-b0de7449 
1:/foo                  3:1   0175 @0149 store DEST:  
1:/foo                  3:1   0176 @0150 push $complexglobalfunc2* DEST:  
1:/foo                  3:1   0177 @0151 PushDelegateRelocateLater Dest{complexglobalfunc2`0-ac8dec4b} DEST: complexglobalfunc2`0-ac8dec4b 
1:/foo                  3:1   0178 @0152 store DEST:  
1:/foo                  3:1   0179 @0153 push $complexglobalfunc3* DEST:  
1:/foo                  3:1   0180 @0154 PushDelegateRelocateLater Dest{complexglobalfunc3`0-6d4cc034} DEST: complexglobalfunc3`0-6d4cc034 
1:/foo                  3:1   0181 @0155 store DEST:  
1:/foo                  3:1   0182 @0156 push $complexglobalfunc4* DEST:  
1:/foo                  3:1   0183 @0157 PushDelegateRelocateLater Dest{complexglobalfunc4`0-68fc3836} DEST: complexglobalfunc4`0-68fc3836 
1:/foo                  3:1   0184 @0158 store DEST:  
1:/foo                  3:1   0185 @0159 push $somefunclockingthrottle* DEST:  
1:/foo                  3:1   0186 @0160 PushDelegateRelocateLater Dest{somefunclockingthrottle`0-e9b24317} DEST: somefunclockingthrottle`0-e9b24317 
1:/foo                  3:1   0187 @0161 store DEST:  
1:/foo                  3:1   0188 @0162 argbottom DEST:  
1:/foo                  3:8   0189 @0163 push libname DEST:  
1:/foo                  3:19  0190 @0164 push 0 DEST:  
1:/foo                  3:19  0191 @0165 storeglobal DEST:  
1:/foo                  3:29  0192 @0166 push importedlibs DEST:  
1:/foo                  3:52  0193 @0167 push _KOSArgMarker_ DEST:  
1:/foo                  3:52  0194 @0168 call lexicon() DEST:  
1:/foo                  3:52  0195 @0169 storeglobal DEST:  
1:/foo                 22:8   0196 @0170 push somedelegatewithif DEST:  
1:/foo                 22:30  0197 @0171 jump +11 DEST: @0182 
1:/foo                 22:30  0198 @0172 pushscope 4 0 DEST:  
1:/foo                 22:30  0199 @0173 argbottom DEST:  
1:/foo                 22:34  0200 @0174 push True DEST:  
1:/foo                 22:34  0201 @0175 br.false +4 DEST: @0179 
1:/foo                 22:43  0202 @0176 push $something DEST:  
1:/foo                 22:56  0203 @0177 push 0 DEST:  
1:/foo                 22:56  0204 @0178 store DEST:  
1:/foo                 22:58  0205 @0179 popscope 1 DEST:  
1:/foo                 22:58  0206 @0180 push 0 DEST:  
1:/foo                 22:58  0207 @0181 return 0 deep DEST:  
1:/foo                 22:58  0208 @0182 PushDelegateRelocateLater Dest{@0172} DEST: @0172 
1:/foo                 22:58  0209 @0183 storeglobal DEST:  
1:/foo                 32:5   0210 @0184 push $bar_uncompiled DEST:  
1:/foo                 32:29  0211 @0185 push _KOSArgMarker_ DEST:  
1:/foo                 32:30  0212 @0186 push bar_src DEST:  
1:/foo                 32:30  0213 @0187 call $import* DEST:  
1:/foo                 32:30  0214 @0188 store DEST:  
1:/foo                 33:1   0215 @0189 push $bar_uncompiled DEST:  
1:/foo                 33:16  0216 @0190 push bar DEST:  
1:/foo                 33:16  0217 @0191 getindex DEST:  
1:/foo                 33:22  0218 @0192 push _KOSArgMarker_ DEST:  
1:/foo                 33:22  0219 @0193 call <indirect> DEST:  
1:/foo                 33:22  0220 @0194 pop DEST:  
1:/foo                 33:26  0221 @0195 push _KOSArgMarker_ DEST:  
1:/foo                 33:32  0222 @0196 push --------- DEST:  
1:/foo                 33:32  0223 @0197 call print() DEST:  
1:/foo                 33:32  0224 @0198 pop DEST:  
1:/foo                 33:45  0225 @0199 push _KOSArgMarker_ DEST:  
1:/foo                 33:51  0226 @0200 push   DEST:  
1:/foo                 33:51  0227 @0201 call print() DEST:  
1:/foo                 33:51  0228 @0202 pop DEST:  
1:/foo                 36:1   0229 @0203 push _KOSArgMarker_ DEST:  
1:/foo                 36:9   0230 @0204 push bar_src.ks DEST:  
1:/foo                 36:9   0231 @0205 push False DEST:  
1:/foo                 36:25  0232 @0206 push bar.ksm DEST:  
1:/foo                 36:25  0233 @0207 call load() DEST:  
1:/foo                 36:25  0234 @0208 pop DEST:  
1:/foo                 37:5   0235 @0209 push $bar_compiled DEST:  
1:/foo                 37:27  0236 @0210 push _KOSArgMarker_ DEST:  
1:/foo                 37:28  0237 @0211 push bar DEST:  
1:/foo                 37:28  0238 @0212 call $import* DEST:  
1:/foo                 37:28  0239 @0213 store DEST:  
1:/foo                 40:1   0240 @0214 push $bar_compiled DEST:  
1:/foo                 40:14  0241 @0215 push bar DEST:  
1:/foo                 40:14  0242 @0216 getindex DEST:  
1:/foo                 40:20  0243 @0217 push _KOSArgMarker_ DEST:  
1:/foo                 40:20  0244 @0218 call <indirect> DEST:  
1:/foo                 40:20  0245 @0219 pop DEST:  
$$empty$$:/             0:0   0246  pop DEST: null 
$$empty$$:/             0:0   0247  EOP DEST: null 
1:/bar_src.ks           3:23  0248 simplefunc1`17-cc74a3cd pushscope 18 17 DEST:  
1:/bar_src.ks           3:23  0249 @0221 argbottom DEST:  
1:/bar_src.ks           3:24  0250 @0222 popscope 1 DEST:  
1:/bar_src.ks           3:24  0251 @0223 push 0 DEST:  
1:/bar_src.ks           3:24  0252 @0224 return 0 deep DEST:  
1:/bar_src.ks           4:23  0253 simplefunc2`17-ce297c6c pushscope 19 17 DEST:  
1:/bar_src.ks           4:23  0254 @0226 argbottom DEST:  
1:/bar_src.ks           4:24  0255 @0227 popscope 1 DEST:  
1:/bar_src.ks           4:24  0256 @0228 push 0 DEST:  
1:/bar_src.ks           4:24  0257 @0229 return 0 deep DEST:  
1:/bar_src.ks           5:23  0258 simplefunc3`17-f3b41a16 pushscope 20 17 DEST:  
1:/bar_src.ks           5:23  0259 @0231 argbottom DEST:  
1:/bar_src.ks           5:24  0260 @0232 popscope 1 DEST:  
1:/bar_src.ks           5:24  0261 @0233 push 0 DEST:  
1:/bar_src.ks           5:24  0262 @0234 return 0 deep DEST:  
1:/bar_src.ks           6:24  0263 complexfunc1`17-703ced22 pushscope 21 17 DEST:  
1:/bar_src.ks           6:24  0264 @0236 argbottom DEST:  
1:/bar_src.ks           6:39  0265 @0237 push $ps DEST:  
1:/bar_src.ks           6:39  0266 @0238 push _KOSArgMarker_ DEST:  
1:/bar_src.ks           6:30  0267 @0239 push parts DEST:  
1:/bar_src.ks           6:30  0268 @0240 call buildlist() DEST:  
1:/bar_src.ks           6:30  0269 @0241 store DEST:  
1:/bar_src.ks           6:43  0270 @0242 pushscope 22 21 DEST:  
1:/bar_src.ks           6:43  0271 @0243 push $ps-iterator DEST:  
1:/bar_src.ks           6:53  0272 @0244 push $ps DEST:  
1:/bar_src.ks           6:53  0273 @0245 push iterator DEST:  
1:/bar_src.ks           6:53  0274 @0246 getmember DEST:  
1:/bar_src.ks           6:53  0275 @0247 storelocal DEST:  
1:/bar_src.ks           6:53  0276 @0248 push $ps-iterator DEST:  
1:/bar_src.ks           6:53  0277 @0249 push next DEST:  
1:/bar_src.ks           6:53  0278 @0250 getmember DEST:  
1:/bar_src.ks           6:53  0279 @0251 br.false +13 DEST: @0264 
1:/bar_src.ks           6:47  0280 @0252 push $_p DEST:  
1:/bar_src.ks           6:47  0281 @0253 push $ps-iterator DEST:  
1:/bar_src.ks           6:47  0282 @0254 push value DEST:  
1:/bar_src.ks           6:47  0283 @0255 getmember DEST:  
1:/bar_src.ks           6:47  0284 @0256 storelocal DEST:  
1:/bar_src.ks           6:56  0285 @0257 pushscope 23 22 DEST:  
1:/bar_src.ks           6:60  0286 @0258 push True DEST:  
1:/bar_src.ks           6:60  0287 @0259 br.false +3 DEST: @0262 
1:/bar_src.ks           6:65  0288 @0260 pushscope 24 23 DEST:  
1:/bar_src.ks           6:66  0289 @0261 popscope 1 DEST:  
1:/bar_src.ks           6:67  0290 @0262 popscope 1 DEST:  
1:/bar_src.ks           6:67  0291 @0263 jump -15 DEST: @0248 
1:/bar_src.ks           6:67  0292 @0264 nop DEST:  
1:/bar_src.ks           6:67  0293 @0265 popscope 1 DEST:  
1:/bar_src.ks           6:68  0294 @0266 popscope 1 DEST:  
1:/bar_src.ks           6:68  0295 @0267 push 0 DEST:  
1:/bar_src.ks           6:68  0296 @0268 return 0 deep DEST:  
1:/bar_src.ks           7:24  0297 complexfunc2`17-b5552002 pushscope 25 17 DEST:  
1:/bar_src.ks           7:24  0298 @0274 argbottom DEST:  
1:/bar_src.ks           7:28  0299 @0275 push True DEST:  
1:/bar_src.ks           7:28  0300 @0276 br.false +13 DEST: @0289 
1:/bar_src.ks           7:33  0301 @0277 pushscope 26 25 DEST:  
1:/bar_src.ks           7:34  0302 @0278 push $throttle* DEST:  
1:/bar_src.ks           7:34  0303 @0279 PushDelegateRelocateLater Dest{throttle`0-13f54d99} DEST: throttle`0-13f54d99 
1:/bar_src.ks           7:34  0304 @0280 storeglobal DEST:  
1:/bar_src.ks           7:34  0305 @0281 PushRelocateLater Dest{@0001} DEST: @0001 
1:/bar_src.ks           7:34  0306 @0282 addtrigger DEST:  
1:/bar_src.ks           7:34  0307 @0283 push _KOSArgMarker_ DEST:  
1:/bar_src.ks           7:34  0308 @0284 push throttle DEST:  
1:/bar_src.ks           7:34  0309 @0285 push True DEST:  
1:/bar_src.ks           7:34  0310 @0286 call toggleflybywire() DEST:  
1:/bar_src.ks           7:34  0311 @0287 pop DEST:  
1:/bar_src.ks           7:53  0312 @0288 popscope 1 DEST:  
1:/bar_src.ks           7:56  0313 @0289 popscope 1 DEST:  
1:/bar_src.ks           7:56  0314 @0290 push 0 DEST:  
1:/bar_src.ks           7:56  0315 @0291 return 0 deep DEST:  
1:/bar_src.ks           8:24  0316 complexfunc3`17-69b199c7 pushscope 28 17 DEST:  
1:/bar_src.ks           8:24  0317 @0301 argbottom DEST:  
1:/bar_src.ks           8:28  0318 @0302 push True DEST:  
1:/bar_src.ks           8:28  0319 @0303 br.false +13 DEST: @0316 
1:/bar_src.ks           8:33  0320 @0304 pushscope 29 28 DEST:  
1:/bar_src.ks           8:34  0321 @0305 push $throttle* DEST:  
1:/bar_src.ks           8:34  0322 @0306 PushDelegateRelocateLater Dest{throttle`0-39a21a81} DEST: throttle`0-39a21a81 
1:/bar_src.ks           8:34  0323 @0307 storeglobal DEST:  
1:/bar_src.ks           8:34  0324 @0308 PushRelocateLater Dest{@0001} DEST: @0001 
1:/bar_src.ks           8:34  0325 @0309 addtrigger DEST:  
1:/bar_src.ks           8:34  0326 @0310 push _KOSArgMarker_ DEST:  
1:/bar_src.ks           8:34  0327 @0311 push throttle DEST:  
1:/bar_src.ks           8:34  0328 @0312 push True DEST:  
1:/bar_src.ks           8:34  0329 @0313 call toggleflybywire() DEST:  
1:/bar_src.ks           8:34  0330 @0314 pop DEST:  
1:/bar_src.ks           8:53  0331 @0315 popscope 1 DEST:  
1:/bar_src.ks           8:58  0332 @0316 push True DEST:  
1:/bar_src.ks           8:58  0333 @0317 br.false +13 DEST: @0330 
1:/bar_src.ks           8:63  0334 @0318 pushscope 31 28 DEST:  
1:/bar_src.ks           8:64  0335 @0319 push $throttle* DEST:  
1:/bar_src.ks           8:64  0336 @0320 PushDelegateRelocateLater Dest{throttle`0-fcc5d63f} DEST: throttle`0-fcc5d63f 
1:/bar_src.ks           8:64  0337 @0321 storeglobal DEST:  
1:/bar_src.ks           8:64  0338 @0322 PushRelocateLater Dest{@0001} DEST: @0001 
1:/bar_src.ks           8:64  0339 @0323 addtrigger DEST:  
1:/bar_src.ks           8:64  0340 @0324 push _KOSArgMarker_ DEST:  
1:/bar_src.ks           8:64  0341 @0325 push throttle DEST:  
1:/bar_src.ks           8:64  0342 @0326 push True DEST:  
1:/bar_src.ks           8:64  0343 @0327 call toggleflybywire() DEST:  
1:/bar_src.ks           8:64  0344 @0328 pop DEST:  
1:/bar_src.ks           8:83  0345 @0329 popscope 1 DEST:  
1:/bar_src.ks           8:92  0346 @0330 push 5 DEST:  
1:/bar_src.ks           8:92  0347 @0331 return 1 deep DEST:  
1:/bar_src.ks           9:2   0348 @0332 popscope 1 DEST:  
1:/bar_src.ks           9:2   0349 @0333 push 0 DEST:  
1:/bar_src.ks           9:2   0350 @0334 return 0 deep DEST:  
1:/bar_src.ks           7:34  0351 throttle`0-13f54d99 pushscope 27 26 DEST:  
1:/bar_src.ks           7:34  0352 @0270 argbottom DEST:  
1:/bar_src.ks           7:51  0353 @0271 push 0 DEST:  
1:/bar_src.ks           7:51  0354 @0272 return 1 deep DEST:  
1:/bar_src.ks           8:34  0355 throttle`0-39a21a81 pushscope 30 29 DEST:  
1:/bar_src.ks           8:34  0356 @0293 argbottom DEST:  
1:/bar_src.ks           8:51  0357 @0294 push 0 DEST:  
1:/bar_src.ks           8:51  0358 @0295 return 1 deep DEST:  
1:/bar_src.ks           8:64  0359 throttle`0-fcc5d63f pushscope 32 31 DEST:  
1:/bar_src.ks           8:64  0360 @0297 argbottom DEST:  
1:/bar_src.ks           8:81  0361 @0298 push 0 DEST:  
1:/bar_src.ks           8:81  0362 @0299 return 1 deep DEST:  
1:/bar_src.ks           1:1   0363 @0335 argbottom DEST:  
1:/bar_src.ks           1:1   0364 @0336 pushscope 17 0 DEST:  
1:/bar_src.ks           1:1   0365 @0337 push $simplefunc1* DEST:  
1:/bar_src.ks           1:1   0366 @0338 PushDelegateRelocateLater Dest{simplefunc1`17-cc74a3cd} DEST: simplefunc1`17-cc74a3cd 
1:/bar_src.ks           1:1   0367 @0339 storelocal DEST:  
1:/bar_src.ks           1:1   0368 @0340 push $simplefunc2* DEST:  
1:/bar_src.ks           1:1   0369 @0341 PushDelegateRelocateLater Dest{simplefunc2`17-ce297c6c} DEST: simplefunc2`17-ce297c6c 
1:/bar_src.ks           1:1   0370 @0342 storelocal DEST:  
1:/bar_src.ks           1:1   0371 @0343 push $simplefunc3* DEST:  
1:/bar_src.ks           1:1   0372 @0344 PushDelegateRelocateLater Dest{simplefunc3`17-f3b41a16} DEST: simplefunc3`17-f3b41a16 
1:/bar_src.ks           1:1   0373 @0345 storelocal DEST:  
1:/bar_src.ks           1:1   0374 @0346 push $complexfunc1* DEST:  
1:/bar_src.ks           1:1   0375 @0347 PushDelegateRelocateLater Dest{complexfunc1`17-703ced22} DEST: complexfunc1`17-703ced22 
1:/bar_src.ks           1:1   0376 @0348 storelocal DEST:  
1:/bar_src.ks           1:1   0377 @0349 push $complexfunc2* DEST:  
1:/bar_src.ks           1:1   0378 @0350 PushDelegateRelocateLater Dest{complexfunc2`17-b5552002} DEST: complexfunc2`17-b5552002 
1:/bar_src.ks           1:1   0379 @0351 storelocal DEST:  
1:/bar_src.ks           1:1   0380 @0352 push $complexfunc3* DEST:  
1:/bar_src.ks           1:1   0381 @0353 PushDelegateRelocateLater Dest{complexfunc3`17-69b199c7} DEST: complexfunc3`17-69b199c7 
1:/bar_src.ks           1:1   0382 @0354 storelocal DEST:  
1:/bar_src.ks          11:8   0383 @0355 push _KOSArgMarker_ DEST:  
1:/bar_src.ks          11:16  0384 @0356 push _KOSArgMarker_ DEST:  
1:/bar_src.ks          12:3   0385 @0357 push bar DEST:  
1:/bar_src.ks          12:10  0386 @0358 jump +10 DEST: @0368 
1:/bar_src.ks          12:10  0387 @0359 pushscope 33 17 DEST:  
1:/bar_src.ks          12:10  0388 @0360 argbottom DEST:  
1:/bar_src.ks          12:11  0389 @0361 push _KOSArgMarker_ DEST:  
1:/bar_src.ks          12:17  0390 @0362 push Bar!!! DEST:  
1:/bar_src.ks          12:17  0391 @0363 call print() DEST:  
1:/bar_src.ks          12:17  0392 @0364 pop DEST:  
1:/bar_src.ks          12:26  0393 @0365 popscope 1 DEST:  
1:/bar_src.ks          12:26  0394 @0366 push 0 DEST:  
1:/bar_src.ks          12:26  0395 @0367 return 0 deep DEST:  
1:/bar_src.ks          12:26  0396 @0368 PushDelegateRelocateLater Dest{@0359} DEST: @0359 
1:/bar_src.ks          12:26  0397 @0369 call lexicon() DEST:  
1:/bar_src.ks          12:26  0398 @0370 call $export* DEST:  
1:/bar_src.ks          12:26  0399 @0371 pop DEST:  
1:/bar_src.ks          14:1   0400 @0372 popscope 1 DEST:  
$$empty$$:/             0:0   0401  push 0 DEST: null 
$$empty$$:/             0:0   0402  return 0 deep DEST: null 
1:/bar.ksm              3:0   0403 simplefunc1`1-782e4086 pushscope 2 1 DEST: null 
1:/bar.ksm              3:0   0404 @403_0008 argbottom DEST: null 
1:/bar.ksm              3:0   0405 @403_0009 popscope 1 DEST: null 
1:/bar.ksm              3:0   0406 @403_0010 push 0 DEST: null 
1:/bar.ksm              3:0   0407 @403_0011 return 0 deep DEST: null 
1:/bar.ksm              4:0   0408 simplefunc2`1-79e31925 pushscope 3 1 DEST: null 
1:/bar.ksm              4:0   0409 @403_0013 argbottom DEST: null 
1:/bar.ksm              4:0   0410 @403_0014 popscope 1 DEST: null 
1:/bar.ksm              4:0   0411 @403_0015 push 0 DEST: null 
1:/bar.ksm              4:0   0412 @403_0016 return 0 deep DEST: null 
1:/bar.ksm              5:0   0413 simplefunc3`1-7b97f1c4 pushscope 4 1 DEST: null 
1:/bar.ksm              5:0   0414 @403_0018 argbottom DEST: null 
1:/bar.ksm              5:0   0415 @403_0019 popscope 1 DEST: null 
1:/bar.ksm              5:0   0416 @403_0020 push 0 DEST: null 
1:/bar.ksm              5:0   0417 @403_0021 return 0 deep DEST: null 
1:/bar.ksm              6:0   0418 complexfunc1`1-ee6b1e9a pushscope 5 1 DEST: null 
1:/bar.ksm              6:0   0419 @403_0023 argbottom DEST: null 
1:/bar.ksm              6:0   0420 @403_0024 push $ps DEST: null 
1:/bar.ksm              6:0   0421 @403_0025 push _KOSArgMarker_ DEST: null 
1:/bar.ksm              6:0   0422 @403_0026 push parts DEST: null 
1:/bar.ksm              6:0   0423 @403_0027 call buildlist() DEST:  
1:/bar.ksm              6:0   0424 @403_0028 store DEST: null 
1:/bar.ksm              6:0   0425 @403_0029 pushscope 6 5 DEST: null 
1:/bar.ksm              6:0   0426 @403_0030 push $ps-iterator DEST: null 
1:/bar.ksm              6:0   0427 @403_0031 push $ps DEST: null 
1:/bar.ksm              6:0   0428 @403_0032 push iterator DEST: null 
1:/bar.ksm              6:0   0429 @403_0033 getmember DEST: null 
1:/bar.ksm              6:0   0430 @403_0034 storelocal DEST: null 
1:/bar.ksm              6:0   0431 @403_0035 push $ps-iterator DEST: null 
1:/bar.ksm              6:0   0432 @403_0036 push next DEST: null 
1:/bar.ksm              6:0   0433 @403_0037 getmember DEST: null 
1:/bar.ksm              6:0   0434 @403_0038 br.false +0 DEST: @403_0051 
1:/bar.ksm              6:0   0435 @403_0039 push $_p DEST: null 
1:/bar.ksm              6:0   0436 @403_0040 push $ps-iterator DEST: null 
1:/bar.ksm              6:0   0437 @403_0041 push value DEST: null 
1:/bar.ksm              6:0   0438 @403_0042 getmember DEST: null 
1:/bar.ksm              6:0   0439 @403_0043 storelocal DEST: null 
1:/bar.ksm              6:0   0440 @403_0044 pushscope 7 6 DEST: null 
1:/bar.ksm              6:0   0441 @403_0045 push True DEST: null 
1:/bar.ksm              6:0   0442 @403_0046 br.false +0 DEST: @403_0049 
1:/bar.ksm              6:0   0443 @403_0047 pushscope 8 7 DEST: null 
1:/bar.ksm              6:0   0444 @403_0048 popscope 1 DEST: null 
1:/bar.ksm              6:0   0445 @403_0049 popscope 1 DEST: null 
1:/bar.ksm              6:0   0446 @403_0050 jump +0 DEST: @403_0035 
1:/bar.ksm              6:0   0447 @403_0051 nop DEST: null 
1:/bar.ksm              6:0   0448 @403_0052 popscope 1 DEST: null 
1:/bar.ksm              6:0   0449 @403_0053 popscope 1 DEST: null 
1:/bar.ksm              6:0   0450 @403_0054 push 0 DEST: null 
1:/bar.ksm              6:0   0451 @403_0055 return 0 deep DEST: null 
1:/bar.ksm              7:0   0452 throttle`0-c763171f pushscope 11 10 DEST: null 
1:/bar.ksm              7:0   0453 @403_0066 argbottom DEST: null 
1:/bar.ksm              7:0   0454 @403_0067 push 0 DEST: null 
1:/bar.ksm              7:0   0455 @403_0068 return 1 deep DEST: null 
1:/bar.ksm              8:0   0456 throttle`0-6c18b0bc pushscope 14 13 DEST: null 
1:/bar.ksm              8:0   0457 @403_0089 argbottom DEST: null 
1:/bar.ksm              8:0   0458 @403_0090 push 0 DEST: null 
1:/bar.ksm              8:0   0459 @403_0091 return 1 deep DEST: null 
1:/bar.ksm              8:0   0460 throttle`0-2f3c6c7a pushscope 16 15 DEST: null 
1:/bar.ksm              8:0   0461 @403_0093 argbottom DEST: null 
1:/bar.ksm              8:0   0462 @403_0094 push 0 DEST: null 
1:/bar.ksm              8:0   0463 @403_0095 return 1 deep DEST: null 
1:/bar.ksm              7:0   0464 throttle`0-default argbottom DEST: null 
1:/bar.ksm              7:0   0465 @403_0063 push $throttle DEST: null 
1:/bar.ksm              7:0   0466 @403_0064 return 0 deep DEST: null 
1:/bar.ksm              7:0   0467 complexfunc2`1-12faaaf3 pushscope 9 1 DEST: null 
1:/bar.ksm              7:0   0468 @403_0070 argbottom DEST: null 
1:/bar.ksm              7:0   0469 @403_0071 push True DEST: null 
1:/bar.ksm              7:0   0470 @403_0072 br.false +0 DEST: @403_0085 
1:/bar.ksm              7:0   0471 @403_0073 pushscope 10 9 DEST: null 
1:/bar.ksm              7:0   0472 @403_0074 push $throttle* DEST: null 
1:/bar.ksm              7:0   0473 @403_0075 PushDelegateRelocateLater Dest{throttle`0-c763171f} DEST: throttle`0-c763171f 
1:/bar.ksm              7:0   0474 @403_0076 storeglobal DEST: null 
1:/bar.ksm              7:0   0475 @403_0077 PushRelocateLater Dest{@403_0001} DEST: @403_0001 
1:/bar.ksm              7:0   0476 @403_0078 addtrigger DEST: null 
1:/bar.ksm              7:0   0477 @403_0079 push _KOSArgMarker_ DEST: null 
1:/bar.ksm              7:0   0478 @403_0080 push throttle DEST: null 
1:/bar.ksm              7:0   0479 @403_0081 push True DEST: null 
1:/bar.ksm              7:0   0480 @403_0082 call toggleflybywire() DEST:  
1:/bar.ksm              7:0   0481 @403_0083 pop DEST: null 
1:/bar.ksm              7:0   0482 @403_0084 popscope 1 DEST: null 
1:/bar.ksm              7:0   0483 @403_0085 popscope 1 DEST: null 
1:/bar.ksm              7:0   0484 @403_0086 push 0 DEST: null 
1:/bar.ksm              7:0   0485 @403_0087 return 0 deep DEST: null 
1:/bar.ksm              8:0   0486 complexfunc3`1-cde3b574 pushscope 12 1 DEST: null 
1:/bar.ksm              8:0   0487 @403_0097 argbottom DEST: null 
1:/bar.ksm              8:0   0488 @403_0098 push True DEST: null 
1:/bar.ksm              8:0   0489 @403_0099 br.false +0 DEST: @403_0112 
1:/bar.ksm              8:0   0490 @403_0100 pushscope 13 12 DEST: null 
1:/bar.ksm              8:0   0491 @403_0101 push $throttle* DEST: null 
1:/bar.ksm              8:0   0492 @403_0102 PushDelegateRelocateLater Dest{throttle`0-6c18b0bc} DEST: throttle`0-6c18b0bc 
1:/bar.ksm              8:0   0493 @403_0103 storeglobal DEST: null 
1:/bar.ksm              8:0   0494 @403_0104 PushRelocateLater Dest{@403_0001} DEST: @403_0001 
1:/bar.ksm              8:0   0495 @403_0105 addtrigger DEST: null 
1:/bar.ksm              8:0   0496 @403_0106 push _KOSArgMarker_ DEST: null 
1:/bar.ksm              8:0   0497 @403_0107 push throttle DEST: null 
1:/bar.ksm              8:0   0498 @403_0108 push True DEST: null 
1:/bar.ksm              8:0   0499 @403_0109 call toggleflybywire() DEST:  
1:/bar.ksm              8:0   0500 @403_0110 pop DEST: null 
1:/bar.ksm              8:0   0501 @403_0111 popscope 1 DEST: null 
1:/bar.ksm              8:0   0502 @403_0112 push True DEST: null 
1:/bar.ksm              8:0   0503 @403_0113 br.false +0 DEST: @403_0126 
1:/bar.ksm              8:0   0504 @403_0114 pushscope 15 12 DEST: null 
1:/bar.ksm              8:0   0505 @403_0115 push $throttle* DEST: null 
1:/bar.ksm              8:0   0506 @403_0116 PushDelegateRelocateLater Dest{throttle`0-2f3c6c7a} DEST: throttle`0-2f3c6c7a 
1:/bar.ksm              8:0   0507 @403_0117 storeglobal DEST: null 
1:/bar.ksm              8:0   0508 @403_0118 PushRelocateLater Dest{@403_0001} DEST: @403_0001 
1:/bar.ksm              8:0   0509 @403_0119 addtrigger DEST: null 
1:/bar.ksm              8:0   0510 @403_0120 push _KOSArgMarker_ DEST: null 
1:/bar.ksm              8:0   0511 @403_0121 push throttle DEST: null 
1:/bar.ksm              8:0   0512 @403_0122 push True DEST: null 
1:/bar.ksm              8:0   0513 @403_0123 call toggleflybywire() DEST:  
1:/bar.ksm              8:0   0514 @403_0124 pop DEST: null 
1:/bar.ksm              8:0   0515 @403_0125 popscope 1 DEST: null 
1:/bar.ksm              8:0   0516 @403_0126 push 5 DEST: null 
1:/bar.ksm              8:0   0517 @403_0127 return 1 deep DEST: null 
1:/bar.ksm              9:0   0518 @403_0128 popscope 1 DEST: null 
1:/bar.ksm              9:0   0519 @403_0129 push 0 DEST: null 
1:/bar.ksm              9:0   0520 @403_0130 return 0 deep DEST: null 
1:/bar.ksm             -1:0   0521 @403_0001 push $throttle DEST: null 
1:/bar.ksm             -1:0   0522 @403_0002 push _KOSArgMarker_ DEST: null 
1:/bar.ksm             -1:0   0523 @403_0003 call $throttle* DEST:  
1:/bar.ksm             -1:0   0524 @403_0004 storeglobal DEST: null 
1:/bar.ksm             -1:0   0525 @403_0005 push True DEST: null 
1:/bar.ksm             -1:0   0526 @403_0006 return 0 deep DEST: null 
1:/bar.ksm              7:0   0527 @403_0056 push $throttle* DEST: null 
1:/bar.ksm              7:0   0528 @403_0057 exists DEST: null 
1:/bar.ksm              7:0   0529 @403_0058 br.true +4 DEST: null 
1:/bar.ksm              7:0   0530 @403_0059 push $throttle* DEST: null 
1:/bar.ksm              7:0   0531 @403_0060 PushRelocateLater Dest{throttle`0-default} DEST: throttle`0-default 
1:/bar.ksm              7:0   0532 @403_0061 store DEST: null 
1:/bar.ksm              1:0   0533 @403_0131 argbottom DEST: null 
1:/bar.ksm              1:0   0534 @403_0132 pushscope 1 0 DEST: null 
1:/bar.ksm              1:0   0535 @403_0133 push $simplefunc1* DEST: null 
1:/bar.ksm              1:0   0536 @403_0134 PushDelegateRelocateLater Dest{simplefunc1`1-782e4086} DEST: simplefunc1`1-782e4086 
1:/bar.ksm              1:0   0537 @403_0135 storelocal DEST: null 
1:/bar.ksm              1:0   0538 @403_0136 push $simplefunc2* DEST: null 
1:/bar.ksm              1:0   0539 @403_0137 PushDelegateRelocateLater Dest{simplefunc2`1-79e31925} DEST: simplefunc2`1-79e31925 
1:/bar.ksm              1:0   0540 @403_0138 storelocal DEST: null 
1:/bar.ksm              1:0   0541 @403_0139 push $simplefunc3* DEST: null 
1:/bar.ksm              1:0   0542 @403_0140 PushDelegateRelocateLater Dest{simplefunc3`1-7b97f1c4} DEST: simplefunc3`1-7b97f1c4 
1:/bar.ksm              1:0   0543 @403_0141 storelocal DEST: null 
1:/bar.ksm              1:0   0544 @403_0142 push $complexfunc1* DEST: null 
1:/bar.ksm              1:0   0545 @403_0143 PushDelegateRelocateLater Dest{complexfunc1`1-ee6b1e9a} DEST: complexfunc1`1-ee6b1e9a 
1:/bar.ksm              1:0   0546 @403_0144 storelocal DEST: null 
1:/bar.ksm              1:0   0547 @403_0145 push $complexfunc2* DEST: null 
1:/bar.ksm              1:0   0548 @403_0146 PushDelegateRelocateLater Dest{complexfunc2`1-12faaaf3} DEST: complexfunc2`1-12faaaf3 
1:/bar.ksm              1:0   0549 @403_0147 storelocal DEST: null 
1:/bar.ksm              1:0   0550 @403_0148 push $complexfunc3* DEST: null 
1:/bar.ksm              1:0   0551 @403_0149 PushDelegateRelocateLater Dest{complexfunc3`1-cde3b574} DEST: complexfunc3`1-cde3b574 
1:/bar.ksm              1:0   0552 @403_0150 storelocal DEST: null 
1:/bar.ksm             11:0   0553 @403_0151 push _KOSArgMarker_ DEST: null 
1:/bar.ksm             11:0   0554 @403_0152 push _KOSArgMarker_ DEST: null 
1:/bar.ksm             12:0   0555 @403_0153 push bar DEST: null 
1:/bar.ksm             12:0   0556 @403_0154 jump +0 DEST: @403_0164 
1:/bar.ksm             12:0   0557 @403_0155 pushscope 17 1 DEST: null 
1:/bar.ksm             12:0   0558 @403_0156 argbottom DEST: null 
1:/bar.ksm             12:0   0559 @403_0157 push _KOSArgMarker_ DEST: null 
1:/bar.ksm             12:0   0560 @403_0158 push Bar!!! DEST: null 
1:/bar.ksm             12:0   0561 @403_0159 call print() DEST:  
1:/bar.ksm             12:0   0562 @403_0160 pop DEST: null 
1:/bar.ksm             12:0   0563 @403_0161 popscope 1 DEST: null 
1:/bar.ksm             12:0   0564 @403_0162 push 0 DEST: null 
1:/bar.ksm             12:0   0565 @403_0163 return 0 deep DEST: null 
1:/bar.ksm             12:0   0566 @403_0164 PushDelegateRelocateLater Dest{@403_0155} DEST: @403_0155 
1:/bar.ksm             12:0   0567 @403_0165 call lexicon() DEST:  
1:/bar.ksm             12:0   0568 @403_0166 call export DEST:  
1:/bar.ksm             12:0   0569 @403_0167 pop DEST: null 
1:/bar.ksm             14:0   0570 @403_0168 popscope 1 DEST: null 
$$empty$$:/             0:0   0571  push 0 DEST: null 
$$empty$$:/             0:0   0572  return 0 deep DEST: null 


[LOG 19:33:08.260] kOS: At [built-in], line 0

Called from 1:/foo, line 9
		RUNPATH(_lib).
          ^
Called from 1:/foo, line 37
SET bar_compiled TO import("bar").
                           ^

[LOG 19:33:08.261] kOS.Safe.Exceptions.KOSCompileException: ProgramBuilder.ReplaceLabels: Cannot add label throttle`0-2f3c6c7a, label already exists.  Opcode: pushscope 16 15
  at kOS.Safe.Compilation.ProgramBuilder.ReplaceLabels (System.Collections.Generic.List`1 program) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Compilation.ProgramBuilder.BuildProgram () [0x00000] in <filename unknown>:0 
  at kOS.Safe.Execution.ProgramContext.AddObjectParts (IEnumerable`1 parts, System.String objectFileID) [0x00000] in <filename unknown>:0 
  at kOS.Function.FunctionLoad.Execute (kOS.SharedObjects shared) [0x00000] in <filename unknown>:0 
  at kOS.Function.FunctionBase.Execute (kOS.Safe.SafeSharedObjects shared) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Function.FunctionManager.CallFunction (System.String functionName) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Execution.CPU.CallBuiltinFunction (System.String functionName) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Compilation.OpcodeCall.StaticExecute (ICpu cpu, Boolean direct, System.Object destination, Boolean calledFromKOSDelegateCall) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Compilation.OpcodeCall.Execute (ICpu cpu) [0x00000] in <filename unknown>:0 
  at kOS.Safe.Execution.CPU.ExecuteInstruction (IProgramContext context, Boolean doProfiling) [0x00000] in <filename unknown>:0 
[LOG 19:33:08.270] Code Fragment
File                 Line:Col IP   label   opcode operand
====                 ====:=== ==== ================================  
                        0:0   0000         jump +155 
[built-in]              0:0   0001 @LR00   pushscope -999 0 
[built-in]              0:0   0002 @LR01   push $runonce 
[built-in]              0:0   0003 @LR02   swap 
[built-in]              0:0   0004 @LR03   storelocal 
[built-in]              0:0   0005 @LR04   push $filename 
[built-in]              0:0   0006 @LR05   swap 
[built-in]              0:0   0007 @LR06   storelocal 
[built-in]              0:0   0008 @LR07   push _KOSArgMarker_ 
[built-in]              0:0   0009 @LR08   push $filename 
[built-in]              0:0   0010 @LR09   eval 
[built-in]              0:0   0011 @LR10   push True 
[built-in]              0:0   0012 @LR11   push null 
[built-in]              0:0   0013 @LR12   call load() <<--INSTRUCTION POINTER--
[built-in]              0:0   0014 @LR13   br.false +6 
[built-in]              0:0   0015 @LR14   push $runonce 
[built-in]              0:0   0016 @LR15   br.false +4 
[built-in]              0:0   0017 @LR16   pop 
[built-in]              0:0   0018 @LR17   push 0 
[built-in]              0:0   0019 @LR18   return 1 deep 
[built-in]              0:0   0020 @LR19   push $entrypoint 
[built-in]              0:0   0021 @LR20   swap 
[built-in]              0:0   0022 @LR21   storelocal 
[built-in]              0:0   0023 @LR22   call $entrypoint 
[built-in]              0:0   0024 @LR23   pop 
[built-in]              0:0   0025 @LR24   push 0 
[built-in]              0:0   0026 @LR25   return 1 deep 
1:/foo                  4:17  0027 import`0-6a914a99 pushscope 1 0 
1:/foo                  5:12  0028 @0008   push _lib 
1:/foo                  5:12  0029 @0009   swap 
1:/foo                  5:12  0030 @0010   storelocal 
1:/foo                  5:12  0031 @0011   argbottom 
1:/foo                  7:9   0032 @0012   push $importedlibs 
1:/foo                  7:22  0033 @0013   push haskey 
1:/foo                  7:22  0034 @0014   getmethod 
1:/foo                  7:28  0035 @0015   push _KOSArgMarker_ 
1:/foo                  7:29  0036 @0016   push $_lib 
1:/foo                  7:29  0037 @0017   call <indirect> 
1:/foo                  7:29  0038 @0018   not 
1:/foo                  7:29  0039 @0019   br.false +16 
1:/foo                  7:35  0040 @0020   pushscope 2 1 
1:/foo                  8:7   0041 @0021   push $libname 
1:/foo                  8:18  0042 @0022   push $_lib 
1:/foo                  8:18  0043 @0023   store 
1:/foo                  9:3   0044 @0024   push _KOSArgMarker_ 
1:/foo                  9:3   0045 @0025   push _KOSArgMarker_ 
1:/foo                  9:3   0046 @0026   push False 
1:/foo                  9:11  0047 @0027   push $_lib 
1:/foo                  9:11  0048 @0028   eval 
1:/foo                  9:11  0049 @0029   call 1 
1:/foo                  9:11  0050 @0030   pop 
1:/foo                 10:7   0051 @0031   push $libname 
1:/foo                 10:18  0052 @0032   push 0 
1:/foo                 10:18  0053 @0033   store 
1:/foo                 11:2   0054 @0034   popscope 1 
1:/foo                 12:9   0055 @0035   push $importedlibs 
1:/foo                 12:22  0056 @0036   push $_lib 
1:/foo                 12:22  0057 @0037   getindex 
1:/foo                 12:22  0058 @0038   return 1 deep 
1:/foo                 13:1   0059 @0039   popscope 1 
1:/foo                 13:1   0060 @0040   push 0 
1:/foo                 13:1   0061 @0041   return 0 deep 
1:/foo                 14:17  0062 export`0-972f9a53 pushscope 3 0 
1:/foo                 15:12  0063 @0043   push stuff 
1:/foo                 15:12  0064 @0044   swap 
1:/foo                 15:12  0065 @0045   storelocal 
1:/foo                 15:12  0066 @0046   argbottom 
1:/foo                 17:5   0067 @0047   push $libname 
1:/foo                 17:13  0068 @0048   push 0 
1:/foo                 17:12  0069 @0049   eq 
1:/foo                 17:12  0070 @0050   br.false +4 
1:/foo                 17:27  0071 @0051   push _KOSArgMarker_ 
1:/foo                 17:27  0072 @0052   call cannotexport 
1:/foo                 17:27  0073 @0053   pop 
1:/foo                 18:6   0074 @0054   push $importedlibs 
1:/foo                 18:19  0075 @0055   push $libname 
1:/foo                 18:31  0076 @0056   push $stuff 
1:/foo                 18:31  0077 @0057   setindex 
1:/foo                 19:1   0078 @0058   popscope 1 
1:/foo                 19:1   0079 @0059   push 0 
1:/foo                 19:1   0080 @0060   return 0 deep 
1:/foo                 23:28  0081 simpleglobalfunc1`0-7d4cca63 pushscope 5 0 
1:/foo                 23:28  0082 @0062   argbottom 
1:/foo                 23:29  0083 @0063   popscope 1 
1:/foo                 23:29  0084 @0064   push 0 
1:/foo                 23:29  0085 @0065   return 0 deep 
1:/foo                 24:28  0086 simpleglobalfunc2`0-7f01a302 pushscope 6 0 
1:/foo                 24:28  0087 @0067   argbottom 
1:/foo                 24:29  0088 @0068   popscope 1 
1:/foo                 24:29  0089 @0069   push 0 
1:/foo                 24:29  0090 @0070   return 0 deep 
1:/foo                 25:29  0091 complexglobalfunc1`0-b0de7449 pushscope 7 0 
1:/foo                 25:29  0092 @0072   argbottom 
1:/foo                 25:33  0093 @0073   push True 
1:/foo                 25:33  0094 @0074   br.false +3 
1:/foo                 25:38  0095 @0075   pushscope 8 7 
1:/foo                 25:39  0096 @0076   popscope 1 
1:/foo                 25:40  0097 @0077   popscope 1 
1:/foo                 25:40  0098 @0078   push 0 
1:/foo                 25:40  0099 @0079   return 0 deep 
1:/foo                 26:29  0100 complexglobalfunc2`0-ac8dec4b pushscope 9 0 
1:/foo                 26:29  0101 @0081   argbottom 
1:/foo                 26:33  0102 @0082   push True 
1:/foo                 26:33  0103 @0083   br.false +3 
1:/foo                 26:38  0104 @0084   pushscope 10 9 
1:/foo                 26:39  0105 @0085   popscope 1 
1:/foo                 26:40  0106 @0086   popscope 1 
1:/foo                 26:40  0107 @0087   push 0 
1:/foo                 26:40  0108 @0088   return 0 deep 
1:/foo                 27:29  0109 complexglobalfunc3`0-6d4cc034 pushscope 11 0 
1:/foo                 27:29  0110 @0090   argbottom 
1:/foo                 27:33  0111 @0091   push True 
1:/foo                 27:33  0112 @0092   br.false +3 
1:/foo                 27:38  0113 @0093   pushscope 12 11 
1:/foo                 27:39  0114 @0094   popscope 1 
1:/foo                 27:40  0115 @0095   popscope 1 
1:/foo                 27:40  0116 @0096   push 0 
1:/foo                 27:40  0117 @0097   return 0 deep 
1:/foo                 28:29  0118 complexglobalfunc4`0-68fc3836 pushscope 13 0 
1:/foo                 28:29  0119 @0099   argbottom 
1:/foo                 28:33  0120 @0100   push True 
1:/foo                 28:33  0121 @0101   br.false +3 
1:/foo                 28:38  0122 @0102   pushscope 14 13 
1:/foo                 28:39  0123 @0103   popscope 1 
1:/foo                 28:40  0124 @0104   popscope 1 
1:/foo                 28:40  0125 @0105   push 0 
1:/foo                 28:40  0126 @0106   return 0 deep 
1:/foo                 29:35  0127 throttle`0-2f3c6c7a pushscope 16 15 
1:/foo                 29:35  0128 @0117   argbottom 
1:/foo                 29:52  0129 @0118   push 0 
1:/foo                 29:52  0130 @0119   return 1 deep 
1:/foo                 29:35  0131 throttle`0-default argbottom 
1:/foo                 29:35  0132 @0114   push $throttle 
1:/foo                 29:35  0133 @0115   return 0 deep 
1:/foo                 29:34  0134 somefunclockingthrottle`0-e9b24317 pushscope 15 0 
1:/foo                 29:34  0135 @0121   argbottom 
1:/foo                 29:35  0136 @0122   push $throttle* 
1:/foo                 29:35  0137 @0123   pushdelegate 127 
1:/foo                 29:35  0138 @0124   storeglobal 
1:/foo                 29:35  0139 @0125   push 149 
1:/foo                 29:35  0140 @0126   addtrigger 
1:/foo                 29:35  0141 @0127   push _KOSArgMarker_ 
1:/foo                 29:35  0142 @0128   push throttle 
1:/foo                 29:35  0143 @0129   push True 
1:/foo                 29:35  0144 @0130   call toggleflybywire() 
1:/foo                 29:35  0145 @0131   pop 
1:/foo                 29:54  0146 @0132   popscope 1 
1:/foo                 29:54  0147 @0133   push 0 
1:/foo                 29:54  0148 @0134   return 0 deep 
1:/foo                 -1:0   0149 @0001   push $throttle 
1:/foo                 -1:0   0150 @0002   push _KOSArgMarker_ 
1:/foo                 -1:0   0151 @0003   call $throttle* 
1:/foo                 -1:0   0152 @0004   storeglobal 
1:/foo                 -1:0   0153 @0005   push True 
1:/foo                 -1:0   0154 @0006   return 0 deep 
1:/foo                 29:35  0155 @0107   push $throttle* 
1:/foo                 29:35  0156 @0108   exists 
1:/foo                 29:35  0157 @0109   br.true +4 
1:/foo                 29:35  0158 @0110   push $throttle* 
1:/foo                 29:35  0159 @0111   push 131 
1:/foo                 29:35  0160 @0112   store 
1:/foo                  3:1   0161 @0135   push $import* 
1:/foo                  3:1   0162 @0136   pushdelegate 27 
1:/foo                  3:1   0163 @0137   store 
1:/foo                  3:1   0164 @0138   push $export* 
1:/foo                  3:1   0165 @0139   pushdelegate 62 
1:/foo                  3:1   0166 @0140   store 
1:/foo                  3:1   0167 @0141   push $simpleglobalfunc1* 
1:/foo                  3:1   0168 @0142   pushdelegate 81 
1:/foo                  3:1   0169 @0143   store 
1:/foo                  3:1   0170 @0144   push $simpleglobalfunc2* 
1:/foo                  3:1   0171 @0145   pushdelegate 86 
1:/foo                  3:1   0172 @0146   store 
1:/foo                  3:1   0173 @0147   push $complexglobalfunc1* 
1:/foo                  3:1   0174 @0148   pushdelegate 91 
1:/foo                  3:1   0175 @0149   store 
1:/foo                  3:1   0176 @0150   push $complexglobalfunc2* 
1:/foo                  3:1   0177 @0151   pushdelegate 100 
1:/foo                  3:1   0178 @0152   store 
1:/foo                  3:1   0179 @0153   push $complexglobalfunc3* 
1:/foo                  3:1   0180 @0154   pushdelegate 109 
1:/foo                  3:1   0181 @0155   store 
1:/foo                  3:1   0182 @0156   push $complexglobalfunc4* 
1:/foo                  3:1   0183 @0157   pushdelegate 118 
1:/foo                  3:1   0184 @0158   store 
1:/foo                  3:1   0185 @0159   push $somefunclockingthrottle* 
1:/foo                  3:1   0186 @0160   pushdelegate 134 
1:/foo                  3:1   0187 @0161   store 
1:/foo                  3:1   0188 @0162   argbottom 
1:/foo                  3:8   0189 @0163   push libname 
1:/foo                  3:19  0190 @0164   push 0 
1:/foo                  3:19  0191 @0165   storeglobal 
1:/foo                  3:29  0192 @0166   push importedlibs 
1:/foo                  3:52  0193 @0167   push _KOSArgMarker_ 
1:/foo                  3:52  0194 @0168   call lexicon() 
1:/foo                  3:52  0195 @0169   storeglobal 
1:/foo                 22:8   0196 @0170   push somedelegatewithif 
1:/foo                 22:30  0197 @0171   jump +11 
1:/foo                 22:30  0198 @0172   pushscope 4 0 
1:/foo                 22:30  0199 @0173   argbottom 
1:/foo                 22:34  0200 @0174   push True 
1:/foo                 22:34  0201 @0175   br.false +4 
1:/foo                 22:43  0202 @0176   push $something 
1:/foo                 22:56  0203 @0177   push 0 
1:/foo                 22:56  0204 @0178   store 
1:/foo                 22:58  0205 @0179   popscope 1 
1:/foo                 22:58  0206 @0180   push 0 
1:/foo                 22:58  0207 @0181   return 0 deep 
1:/foo                 22:58  0208 @0182   pushdelegate 198 
1:/foo                 22:58  0209 @0183   storeglobal 
1:/foo                 32:5   0210 @0184   push $bar_uncompiled 
1:/foo                 32:29  0211 @0185   push _KOSArgMarker_ 
1:/foo                 32:30  0212 @0186   push bar_src 
1:/foo                 32:30  0213 @0187   call $import* 
1:/foo                 32:30  0214 @0188   store 
1:/foo                 33:1   0215 @0189   push $bar_uncompiled 
1:/foo                 33:16  0216 @0190   push bar 
1:/foo                 33:16  0217 @0191   getindex 
1:/foo                 33:22  0218 @0192   push _KOSArgMarker_ 
1:/foo                 33:22  0219 @0193   call <indirect> 
1:/foo                 33:22  0220 @0194   pop 
1:/foo                 33:26  0221 @0195   push _KOSArgMarker_ 
1:/foo                 33:32  0222 @0196   push --------- 
1:/foo                 33:32  0223 @0197   call print() 
1:/foo                 33:32  0224 @0198   pop 
1:/foo                 33:45  0225 @0199   push _KOSArgMarker_ 
1:/foo                 33:51  0226 @0200   push   
1:/foo                 33:51  0227 @0201   call print() 
1:/foo                 33:51  0228 @0202   pop 
1:/foo                 36:1   0229 @0203   push _KOSArgMarker_ 
1:/foo                 36:9   0230 @0204   push bar_src.ks 
1:/foo                 36:9   0231 @0205   push False 
1:/foo                 36:25  0232 @0206   push bar.ksm 
1:/foo                 36:25  0233 @0207   call load() 
1:/foo                 36:25  0234 @0208   pop 
1:/foo                 37:5   0235 @0209   push $bar_compiled 
1:/foo                 37:27  0236 @0210   push _KOSArgMarker_ 
1:/foo                 37:28  0237 @0211   push bar 
1:/foo                 37:28  0238 @0212   call $import* 
1:/foo                 37:28  0239 @0213   store 
1:/foo                 40:1   0240 @0214   push $bar_compiled 
1:/foo                 40:14  0241 @0215   push bar 
1:/foo                 40:14  0242 @0216   getindex 
1:/foo                 40:20  0243 @0217   push _KOSArgMarker_ 
1:/foo                 40:20  0244 @0218   call <indirect> 
1:/foo                 40:20  0245 @0219   pop 
                        0:0   0246         pop 
                        0:0   0247         EOP 
1:/bar_src.ks           3:23  0248 simplefunc1`17-cc74a3cd pushscope 18 17 
1:/bar_src.ks           3:23  0249 @0221   argbottom 
1:/bar_src.ks           3:24  0250 @0222   popscope 1 
1:/bar_src.ks           3:24  0251 @0223   push 0 
1:/bar_src.ks           3:24  0252 @0224   return 0 deep 
1:/bar_src.ks           4:23  0253 simplefunc2`17-ce297c6c pushscope 19 17 
1:/bar_src.ks           4:23  0254 @0226   argbottom 
1:/bar_src.ks           4:24  0255 @0227   popscope 1 
1:/bar_src.ks           4:24  0256 @0228   push 0 
1:/bar_src.ks           4:24  0257 @0229   return 0 deep 
1:/bar_src.ks           5:23  0258 simplefunc3`17-f3b41a16 pushscope 20 17 
1:/bar_src.ks           5:23  0259 @0231   argbottom 
1:/bar_src.ks           5:24  0260 @0232   popscope 1 
1:/bar_src.ks           5:24  0261 @0233   push 0 
1:/bar_src.ks           5:24  0262 @0234   return 0 deep 
1:/bar_src.ks           6:24  0263 complexfunc1`17-703ced22 pushscope 21 17 
1:/bar_src.ks           6:24  0264 @0236   argbottom 
1:/bar_src.ks           6:39  0265 @0237   push $ps 
1:/bar_src.ks           6:39  0266 @0238   push _KOSArgMarker_ 
1:/bar_src.ks           6:30  0267 @0239   push parts 
1:/bar_src.ks           6:30  0268 @0240   call buildlist() 
1:/bar_src.ks           6:30  0269 @0241   store 
1:/bar_src.ks           6:43  0270 @0242   pushscope 22 21 
1:/bar_src.ks           6:43  0271 @0243   push $ps-iterator 
1:/bar_src.ks           6:53  0272 @0244   push $ps 
1:/bar_src.ks           6:53  0273 @0245   push iterator 
1:/bar_src.ks           6:53  0274 @0246   getmember 
1:/bar_src.ks           6:53  0275 @0247   storelocal 
1:/bar_src.ks           6:53  0276 @0248   push $ps-iterator 
1:/bar_src.ks           6:53  0277 @0249   push next 
1:/bar_src.ks           6:53  0278 @0250   getmember 
1:/bar_src.ks           6:53  0279 @0251   br.false +13 
1:/bar_src.ks           6:47  0280 @0252   push $_p 
1:/bar_src.ks           6:47  0281 @0253   push $ps-iterator 
1:/bar_src.ks           6:47  0282 @0254   push value 
1:/bar_src.ks           6:47  0283 @0255   getmember 
1:/bar_src.ks           6:47  0284 @0256   storelocal 
1:/bar_src.ks           6:56  0285 @0257   pushscope 23 22 
1:/bar_src.ks           6:60  0286 @0258   push True 
1:/bar_src.ks           6:60  0287 @0259   br.false +3 
1:/bar_src.ks           6:65  0288 @0260   pushscope 24 23 
1:/bar_src.ks           6:66  0289 @0261   popscope 1 
1:/bar_src.ks           6:67  0290 @0262   popscope 1 
1:/bar_src.ks           6:67  0291 @0263   jump -15 
1:/bar_src.ks           6:67  0292 @0264   nop 
1:/bar_src.ks           6:67  0293 @0265   popscope 1 
1:/bar_src.ks           6:68  0294 @0266   popscope 1 
1:/bar_src.ks           6:68  0295 @0267   push 0 
1:/bar_src.ks           6:68  0296 @0268   return 0 deep 
1:/bar_src.ks           7:24  0297 complexfunc2`17-b5552002 pushscope 25 17 
1:/bar_src.ks           7:24  0298 @0274   argbottom 
1:/bar_src.ks           7:28  0299 @0275   push True 
1:/bar_src.ks           7:28  0300 @0276   br.false +13 
1:/bar_src.ks           7:33  0301 @0277   pushscope 26 25 
1:/bar_src.ks           7:34  0302 @0278   push $throttle* 
1:/bar_src.ks           7:34  0303 @0279   pushdelegate 351 
1:/bar_src.ks           7:34  0304 @0280   storeglobal 
1:/bar_src.ks           7:34  0305 @0281   push 149 
1:/bar_src.ks           7:34  0306 @0282   addtrigger 
1:/bar_src.ks           7:34  0307 @0283   push _KOSArgMarker_ 
1:/bar_src.ks           7:34  0308 @0284   push throttle 
1:/bar_src.ks           7:34  0309 @0285   push True 
1:/bar_src.ks           7:34  0310 @0286   call toggleflybywire() 
1:/bar_src.ks           7:34  0311 @0287   pop 
1:/bar_src.ks           7:53  0312 @0288   popscope 1 
1:/bar_src.ks           7:56  0313 @0289   popscope 1 
1:/bar_src.ks           7:56  0314 @0290   push 0 
1:/bar_src.ks           7:56  0315 @0291   return 0 deep 
1:/bar_src.ks           8:24  0316 complexfunc3`17-69b199c7 pushscope 28 17 
1:/bar_src.ks           8:24  0317 @0301   argbottom 
1:/bar_src.ks           8:28  0318 @0302   push True 
1:/bar_src.ks           8:28  0319 @0303   br.false +13 
1:/bar_src.ks           8:33  0320 @0304   pushscope 29 28 
1:/bar_src.ks           8:34  0321 @0305   push $throttle* 
1:/bar_src.ks           8:34  0322 @0306   pushdelegate 355 
1:/bar_src.ks           8:34  0323 @0307   storeglobal 
1:/bar_src.ks           8:34  0324 @0308   push 149 
1:/bar_src.ks           8:34  0325 @0309   addtrigger 
1:/bar_src.ks           8:34  0326 @0310   push _KOSArgMarker_ 
1:/bar_src.ks           8:34  0327 @0311   push throttle 
1:/bar_src.ks           8:34  0328 @0312   push True 
1:/bar_src.ks           8:34  0329 @0313   call toggleflybywire() 
1:/bar_src.ks           8:34  0330 @0314   pop 
1:/bar_src.ks           8:53  0331 @0315   popscope 1 
1:/bar_src.ks           8:58  0332 @0316   push True 
1:/bar_src.ks           8:58  0333 @0317   br.false +13 
1:/bar_src.ks           8:63  0334 @0318   pushscope 31 28 
1:/bar_src.ks           8:64  0335 @0319   push $throttle* 
1:/bar_src.ks           8:64  0336 @0320   pushdelegate 359 
1:/bar_src.ks           8:64  0337 @0321   storeglobal 
1:/bar_src.ks           8:64  0338 @0322   push 149 
1:/bar_src.ks           8:64  0339 @0323   addtrigger 
1:/bar_src.ks           8:64  0340 @0324   push _KOSArgMarker_ 
1:/bar_src.ks           8:64  0341 @0325   push throttle 
1:/bar_src.ks           8:64  0342 @0326   push True 
1:/bar_src.ks           8:64  0343 @0327   call toggleflybywire() 
1:/bar_src.ks           8:64  0344 @0328   pop 
1:/bar_src.ks           8:83  0345 @0329   popscope 1 
1:/bar_src.ks           8:92  0346 @0330   push 5 
1:/bar_src.ks           8:92  0347 @0331   return 1 deep 
1:/bar_src.ks           9:2   0348 @0332   popscope 1 
1:/bar_src.ks           9:2   0349 @0333   push 0 
1:/bar_src.ks           9:2   0350 @0334   return 0 deep 
1:/bar_src.ks           7:34  0351 throttle`0-13f54d99 pushscope 27 26 
1:/bar_src.ks           7:34  0352 @0270   argbottom 
1:/bar_src.ks           7:51  0353 @0271   push 0 
1:/bar_src.ks           7:51  0354 @0272   return 1 deep 
1:/bar_src.ks           8:34  0355 throttle`0-39a21a81 pushscope 30 29 
1:/bar_src.ks           8:34  0356 @0293   argbottom 
1:/bar_src.ks           8:51  0357 @0294   push 0 
1:/bar_src.ks           8:51  0358 @0295   return 1 deep 
1:/bar_src.ks           8:64  0359 throttle`0-fcc5d63f pushscope 32 31 
1:/bar_src.ks           8:64  0360 @0297   argbottom 
1:/bar_src.ks           8:81  0361 @0298   push 0 
1:/bar_src.ks           8:81  0362 @0299   return 1 deep 
1:/bar_src.ks           1:1   0363 @0335   argbottom 
1:/bar_src.ks           1:1   0364 @0336   pushscope 17 0 
1:/bar_src.ks           1:1   0365 @0337   push $simplefunc1* 
1:/bar_src.ks           1:1   0366 @0338   pushdelegate 248 
1:/bar_src.ks           1:1   0367 @0339   storelocal 
1:/bar_src.ks           1:1   0368 @0340   push $simplefunc2* 
1:/bar_src.ks           1:1   0369 @0341   pushdelegate 253 
1:/bar_src.ks           1:1   0370 @0342   storelocal 
1:/bar_src.ks           1:1   0371 @0343   push $simplefunc3* 
1:/bar_src.ks           1:1   0372 @0344   pushdelegate 258 
1:/bar_src.ks           1:1   0373 @0345   storelocal 
1:/bar_src.ks           1:1   0374 @0346   push $complexfunc1* 
1:/bar_src.ks           1:1   0375 @0347   pushdelegate 263 
1:/bar_src.ks           1:1   0376 @0348   storelocal 
1:/bar_src.ks           1:1   0377 @0349   push $complexfunc2* 
1:/bar_src.ks           1:1   0378 @0350   pushdelegate 297 
1:/bar_src.ks           1:1   0379 @0351   storelocal 
1:/bar_src.ks           1:1   0380 @0352   push $complexfunc3* 
1:/bar_src.ks           1:1   0381 @0353   pushdelegate 316 
1:/bar_src.ks           1:1   0382 @0354   storelocal 
1:/bar_src.ks          11:8   0383 @0355   push _KOSArgMarker_ 
1:/bar_src.ks          11:16  0384 @0356   push _KOSArgMarker_ 
1:/bar_src.ks          12:3   0385 @0357   push bar 
1:/bar_src.ks          12:10  0386 @0358   jump +10 
1:/bar_src.ks          12:10  0387 @0359   pushscope 33 17 
1:/bar_src.ks          12:10  0388 @0360   argbottom 
1:/bar_src.ks          12:11  0389 @0361   push _KOSArgMarker_ 
1:/bar_src.ks          12:17  0390 @0362   push Bar!!! 
1:/bar_src.ks          12:17  0391 @0363   call print() 
1:/bar_src.ks          12:17  0392 @0364   pop 
1:/bar_src.ks          12:26  0393 @0365   popscope 1 
1:/bar_src.ks          12:26  0394 @0366   push 0 
1:/bar_src.ks          12:26  0395 @0367   return 0 deep 
1:/bar_src.ks          12:26  0396 @0368   pushdelegate 387 
1:/bar_src.ks          12:26  0397 @0369   call lexicon() 
1:/bar_src.ks          12:26  0398 @0370   call $export* 
1:/bar_src.ks          12:26  0399 @0371   pop 
1:/bar_src.ks          14:1   0400 @0372   popscope 1 
                        0:0   0401         push 0 
                        0:0   0402         return 0 deep 

[LOG 19:33:08.307] kOS: Stack dump: stackPointer = 5
010      SubroutineContext: {CameFromInstPtr 239, TriggerPointer -1} (type: SubroutineContext)
009      kOS.Safe.Execution.VariableScope (type: VariableScope)
          ScopeId=1, ParentScopeId=0, ParentSkipLevels=1 IsClosure=False
            local var $_lib is String with value = bar
008      kOS.Safe.Execution.VariableScope (type: VariableScope)
          ScopeId=2, ParentScopeId=1, ParentSkipLevels=1 IsClosure=False
007      SubroutineContext: {CameFromInstPtr 50, TriggerPointer -1} (type: SubroutineContext)
006      kOS.Safe.Execution.VariableScope (type: VariableScope)
          ScopeId=-999, ParentScopeId=0, ParentSkipLevels=1 IsClosure=False
            local var $runonce is Boolean with value = False
            local var $filename is String with value = bar
005 SP-> _KOSArgMarker_ (type: KOSArgMarkerType)
004      _KOSArgMarker_ (type: KOSArgMarkerType)
003      _KOSArgMarker_ (type: KOSArgMarkerType)
002      $bar_compiled (type: String)
001      _KOSArgMarker_ (type: KOSArgMarkerType)
000      0 (type: Int32)

[LOG 19:33:08.309] kOS: Popping context 2
[LOG 19:33:08.309] kOS: Removed Context File                 Line:Col IP   label   opcode operand
[LOG 19:33:08.310] kOS: Deleting 0 pointers and restoring 0 pointers
[LOG 19:33:08.310] kOS: New current context File                 Line:Col IP   label   opcode operand

 

 

Edited by MaxRebo
addressed earlier reply
Link to comment
Share on other sites

I created small boot script that copy necessary files to kOS CPU on craft launch and start main program.
Works as intended, look like this:

set TERMINAL:CHARHEIGHT to 10.
if not exists("1:/lib_navball")
{
	copypath("0:/lib_navball","1:/lib_navball").
}.
if not exists("1:/mun_land")
{
copypath("0:/mun_land","1:/mun_land").
}.
runpath("1:/mun_land").

I would like to change it to be more universal, if I add more than one CPU on craft, for example.
My question is: What is starting directory when boot script is started on craft launch, assuming that I don't start from archive ?

Would command:

copypath("0:/mun_land","1:/mun_land").

have same effect as this one:

copypath("0:/mun_land","").
// or this one:
copypath("0:/mun_land","/").

Thing that I would like to avoid is to explicitly use volume label in path, but I want to files be copied in CPU that started boot script, not some random CPU that could also be on craft. And also, do I need to create directory on destination CPU before going to copy files, or kOS is capable to recreate whole source path ? I could not figure out this in kOS documentation, have yet to figure it out trough old fashion method of futile attempt.

Edited by kcs123
Link to comment
Share on other sites

@kcs123

http://ksp-kos.github.io/KOS_DOC/general/volumes.html#naming-volumes   

The 1:/ volume always correspond to the volume on which the cpu is running. (As the 0:/ is always the archive)

Only the 2:/ (or higher) volume can be  different from a CPU to another. 

 

Quote

Thing that I would like to avoid is to explicitly use volume label in path, but I want to files be copied in CPU that started boot script, not some random CPU that could also be on craft. And also, do I need to create directory on destination CPU before going to copy files, or kOS is capable to recreate whole source path ? I could not figure out this in kOS documentation, have yet to figure it out trough old fashion method of futile attempt.

 

http://ksp-kos.github.io/KOS_DOC/commands/files.html#copypath-frompath-topath

New file will be created at TOPATH, along with any parent directories if necessary. Its contents will be set to the contents of the file pointed to by FROMPATH.

 

Edited by Chabadarl
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...