Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1027651 // dm_changeModuleLibID [seems to work]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2502L/16K).

svoid dm_changeModuleLibID(O mod, S newLibID) {
  O stem = dm_getStem(mod);
  if (stem == null) ret;
  LS l = splitAtSlash(newLibID);
  if (l(l) != 2) fail("Not a valid lib ID: " + quote(newLibID));
  S moduleID = assertSnippetID(first(l));
  S _className = assertIdentifier(second(l));
  print("Morphing module " + dm_moduleIDAndName(stem) + " into type " + moduleID + "/" + _className); 
  call(stem, '_setFields, +moduleID, +_className);
  dm_reloadModule(stem);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027651
Snippet name: dm_changeModuleLibID [seems to work]
Eternal ID of this version: #1027651/3
Text MD5: 0dba7e4cc7f249d632f536aa6029377c
Transpilation MD5: abaa52cfa75b3dc5acfd2c939118d987
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-29 13:52:20
Source code size: 477 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 215 / 318
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1027677 - dm_changeAllInstancesOfLibID
#1028094 - dm_backupStructureAndChangeModuleLibID