OK. I see the "referent" concept is broader than I had thought. They are not just pointers, but (paraphrasing) expressions awaiting evaluation. The "referent pattern" is more or less the type of the expression, i.e. the type of whatever the expression evaluates to. For example, in Haskell notation:
sum [1,2,3] :: Int Here, "sum [1,2,3]" is the reference. The referent is something which has yet to be determined (the number 6). We know that the referent's type is Int, and we can type-check the expression to be verify that it will produce an Int. Another example: fmap (\n -> "number " ++ show n) $ filter (> 1) [1,2,3] :: [String] Here, "fmap ... [1,2,3]" is the reference, and the referent is a list of strings: ["number 2","number 3"]. Instruction patterns seem like additional "referents" to me, with the difference that they are applied to objects, and that they are composed of concrete instructions. If a referent is nullary (has some type "a"), an instruction pattern seems unary (has some type "a->b", consuming an "a" and producing a "b"). But I need to grok more. Josh On Sun, May 26, 2019 at 6:51 PM Marko Rodriguez <[email protected]> wrote: > Hello, > > >> [db][get,’people’] // *{name:@string, age:!gt(20)&!lt(33)} > >> > >> We have lost information about the “schema.” This is not good as > >> compile-time write validation is not possible. > >> > > > > So far, I am thinking: yeah, dealing with schema changes can be tricky. > > This is not a “schema change” but a greater specification of what the > referents are. Again, a reference is defined by its referent pattern (and > instruction patterns). The referent pattern is a description of the current > instances (referents) while the “schema” is a description of what is legal > for all instances (referents). Without “schema,” I lose compile-time > validation. > > > I then create a people-key on the db map that maintains a > person-reference. > >> > > > > OK. I think by people-key you mean the primary key for the person type, > > i.e. the vertex id. Correct me if I am wrong. > > No. db.get(‘people’) is the "people table.” RDBMSs are modeled as a map > with the keys being the table names and the values being *{:} references to > maps (i.e. rows). > > > I see this as a type plus a constraint. And... you won't be surprised to > > hear me say this... you express it with a select statement: > > > > youngishPeople := σ_{age <= 20 ∧ age >= 33}(people) > > Well, type definitions like this won’t happen at runtime. The VM will just > be able to tell you if the range has been restricted. It won’t create new > types. But yea, referent patterns are (now) a type plus a constraint. > Before, they were just constraints and that is why I lost schema > information at runtime. > > Take care, > Marko. > > http://rredux.com > >
