summaryrefslogtreecommitdiff
path: root/nascent5.js
diff options
context:
space:
mode:
Diffstat (limited to 'nascent5.js')
-rw-r--r--nascent5.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/nascent5.js b/nascent5.js
index b07afec..1d9e8ae 100644
--- a/nascent5.js
+++ b/nascent5.js
@@ -22,7 +22,8 @@ class Properties {
}
has(type, dest) {
for (let p of this.props)
- if (p.type == type && p.dest == dest)
+ if ((p.type == type || isVar(type))
+ && (p.dest == dest || isVar(dest)))
return true
return false
}
@@ -36,6 +37,9 @@ class Properties {
}
return false
}
+ hasIsVar() {
+ return this.has('is','variable')
+ }
}
class AbstractData {
constructor(from) {
@@ -57,6 +61,14 @@ class ArrayData extends Array {
}
}
+// Abstractions?
+const VAR_X = new StringData('X')
+VAR_X.props.add('is','variable')
+// recommend e.g. 'is','variable-rep' when code is designing them, so don't match everything
+function isVar(x) {
+ return x.props && x.props.has('is','variable')
+}
+
// MEMORY
// the archivist. Provides for needs of data. Memory is relevent whenever there is
// an informational need.
@@ -159,7 +171,7 @@ class FunctionData {
//)
// - place a value in such a place
// - retrieve a value from such a place
-// data-structures:
+// data-structures: (these are like promises of what to do and how to use something)
// - make a class definition (collection of variables)
// - initialize an object
// - set/retrieve properties (variables)
@@ -270,6 +282,7 @@ genprophaslines = new FunctionData(
// [how do we pull a need out of the list?]
// make a habit that plans core behavior
+// for some other ideas, see this function in nascent6.js
findstepsfor = new FunctionData(
'findstepsfor',
/*call*/(need, depth) => {