Skip to content

Commit e88cb6c

Browse files
committed
Committed ObjectFramework application @ 2017-08-05_01:29:50
1 parent a080a76 commit e88cb6c

File tree

2 files changed

+32
-79
lines changed

2 files changed

+32
-79
lines changed

ObjectFramework.m

Lines changed: 0 additions & 71 deletions
This file was deleted.

Packages/ObjectFramework.m

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
(* ::Package:: *)
22

3-
$packageHeader
3+
(************************************************************************)
4+
(* This file was generated automatically by the Mathematica front end. *)
5+
(* It contains Initialization cells from a Notebook file, which *)
6+
(* typically will have the same name as this file except ending in *)
7+
(* ".nb" instead of ".m". *)
8+
(* *)
9+
(* This file is intended to be loaded into the Mathematica kernel using *)
10+
(* the package loading commands Get or Needs. Doing so is equivalent *)
11+
(* to using the Evaluate Initialization Cells menu command in the front *)
12+
(* end. *)
13+
(* *)
14+
(* DO NOT EDIT THIS FILE. This entire file is regenerated *)
15+
(* automatically each time the parent Notebook file is saved in the *)
16+
(* Mathematica front end. Any changes you make to this file will be *)
17+
(* overwritten. *)
18+
(************************************************************************)
19+
20+
421

522
$OFObjectTable::usage=
623
"The master table of objects an types";
@@ -122,18 +139,17 @@
122139
];
123140

124141

125-
OFNew[a:{(_Association->_)..}]:=
142+
OFNew[objs:{__Association}]:=
126143
With[{
127-
types=Lookup[Map[First,a],"ObjectType","Object"],
128-
objs=Map[First,a],
129-
args=Map[Last,a]
144+
types=Lookup[objs,"ObjectType","Object"],
145+
args=Lookup[objs,"ObjectInitializationArguments",{}]
130146
},
131147
With[{uuids=CreateUUID[#<>"-"]&/@types},
132148
AssociateTo[$OFObjectTable["Objects"],
133149
MapThread[
134150
#3->
135151
Join[
136-
#,
152+
KeyDrop[#,"ObjectInitializationArguments"],
137153
<|
138154
"ObjectType"->#2
139155
|>
@@ -160,8 +176,16 @@
160176
OFObject/@uuids
161177
]
162178
];
163-
OFNew[s_String,args___]:=
164-
OFNew[<|"ObjectType"->s|>,args];
179+
OFNew[a:{(_String->_Association|_String)..}]:=
180+
OFNew@
181+
Map[
182+
If[Length[#]==2,
183+
Append[#[[2]],"ObjectType"->#[[1]]],
184+
<|"ObjectType"->#|>
185+
]&,
186+
a];
187+
OFNew[a:_Association|_String|(_String->_Association)]:=
188+
First@OFNew[{a}];
165189

166190

167191
OFSelect[pattern_:_]:=

0 commit comments

Comments
 (0)