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

13
LINES

< > BotCompany Repo | #1009875 // persistentObjectFromProgram - load object stored with persistentObject() by another program

JavaX fragment (include)

static <A> A persistentObjectFromProgram(S progID, S name) {
  PersistentLister l = persistentListerReadOnly(progID);
  IVar<A> v = l.getVar(name, null);
  ret v == null ? null : v!;
}

// makeDefaultObject: (func -> A) or Class
static <A> A persistentObjectFromProgram(S progID, S name, O makeDefaultObject) {
  A a = persistentObjectFromProgram(progID, name);
  if (a == null)
    ret (A) (makeDefaultObject instanceof Class ? nu((Class) makeDefaultObject) : callF(makeDefaultObject));
  ret a;
}

Author comment

Began life as a copy of #1009701

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009875
Snippet name: persistentObjectFromProgram - load object stored with persistentObject() by another program
Eternal ID of this version: #1009875/7
Text MD5: 0a58df1640afbb0da33911d46f3ba09d
Author: stefan
Category: javax / lists
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-28 10:01:47
Source code size: 510 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 497 / 528
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010712 - persistentHashMapFromProgram - load object stored with persistentHashMap() by another program