1. 12 Aug, 2019 2 commits
  2. 11 Aug, 2019 1 commit
    • Eric Myhre's avatar
      Partial typed.wrapnodeStruct implementation. · 99058684
      Eric Myhre authored
      It covers the bases on reading, and has a NodeBuilder which works to
      create new nodes based on the type-level structure.
      
      (Quite a few other things about it are incomplete, and it might end
      up getting merged this way, because the goal here was primarily to
      scope out if any of our abstractions will shatter badly, and we've
      now got information on that.)
      
      This seems to indicate we are indeed on the right track, regarding
      some of those comments in the codegeneration work in the previous
      commit: check out the 'Representation' method.  Yep -- we've got
      multiple nodebuilders in our future.
      Signed-off-by: default avatarEric Myhre <hash@exultant.us>
      99058684
  3. 20 Jul, 2019 1 commit
    • Eric Myhre's avatar
      Add typed.ErrNoSuchField and ipld.ErrNotExists. · 8c6af6f5
      Eric Myhre authored
      The latter isn't used yet; that's not the main goal of this branch (and
      I think I'd rather do the refactor to use ipld.ErrNotExists after
      moving the PathSegment types from the selector package into the root...
      which in turn I'm not going to do while some of the other current work
      on Selectors is in progress in other branches.  So!  Latur.); I just
      wanted it around for documentation and clarity of intent.
      
      This also adds a couple of other dummy references to the 'typed'
      package.  I know keeping a set of packages-used-in-this-file is a
      common step in the development of codegen systems targetting golang,
      but I'm going to try to avoid it until the need is really forced.
      8c6af6f5
  4. 10 Jul, 2019 1 commit
    • Eric Myhre's avatar
      Finish ErrWrongKind; add typed.Node.Representation · ecad4261
      Eric Myhre authored
      typed.Node.Representation(), which returns another Node, should address
      most of the infelicies we've found so far in trying to plan nice code
      that works over the schema layer.
      
      Also added in this comment: ipld.ReprKindSet, primarily for use in the
      ErrWrongKind error.  It comes up often enough we might as well formalize
      the thing.
      ecad4261
  5. 25 Jun, 2019 1 commit
    • Eric Myhre's avatar
      Refactor of type/schema code. · 122c5338
      Eric Myhre authored
      - `typed.Node` -> now lives in the `impl/typed` package, more like
      other nodes.
      
      - Most of the other essential parts of reasoning about types moved
      to `schema` package.  ("typed.Type" seemed like a nasty stutter.)
      
      - `typed.Universe` renamed to `schema.TypeSystem`.
      
      - Current `Validate` method moved to `schema` package, but see new
      comments about potential future homes of that code, and its
      aspirational relationship to `typed.Node`.
      
      Conspicuously *not* yet refactored or moved in this comment:
      
      - The `typed/declaration` package -- though it will shortly be scrapped
      and later reappear as `schema/ast`.  The dream is that it would be
      neatest of all if we could generate it by codegen; but we'll see.
      (This would seem to imply we'll have to make sufficient exported
      methods for creating the `schema.Type` values... while we also want
      to make those immutable.  We'll... see.)
      
      - The `typed/gen` package is also untouched in this commit, but
      should similarly move shortly.  The codegen really ought to be built
      against the `schema.Type` reified interfaces.
      
      Overall, this drops the sheer nesting depths of packages a fair bit,
      which seems likely to be a good smell.
      122c5338