Commit Graph

15 Commits

Author SHA1 Message Date
Rafael Weinstein
24826ade3d Remove common noms file & RefBase 2016-04-25 11:20:01 -07:00
Erik Arvidsson
02c47661fd Make all usages of Type in Go use pointers (#1295)
This is in preparation of allowing back references which requires
pointers to be able to compare that the structs are the same.
2016-04-22 15:19:42 -07:00
Chris Masone
82338bb5be Change Value.Chunks() to return []types.RefBase
In pursuit of issue #654, we want to be able to figure out all the
refs contained in a given Value, along with the Types of the Values to
which those refs point. Value.Chunks() _almost_ met those needs, but
it returned a slice of ref.Ref, which doesn't convey any type info.

To address this, this patch does two things:
1) RefBase embeds the Value interface, and
2) Chunks() now returns []types.RefBase

RefBase now provides Type() as well, by virtue of embedding Value, so
callers can just iterate through the slice returned from Chunks() and
gather type info for all the refs embedded in a given Value.

I went all the way and made RefBase a Value instead of just adding the
Type() method because both types.Ref and the generated Ref types are
actually all Values, and doing so allowed me to change the definition of
refBuilderFunc in package_registry.go to be more precise. It now returns
RefBase instead of just Value.
2016-03-21 16:13:14 -06:00
Dan Willhite
7dd540d5d5 Make generated files stable and consistent with go fmt. 2015-11-24 16:15:35 -08:00
Rafael Weinstein
e75f5097c7 Allow Map & Set to order by natural ordering of element type if available. 2015-11-16 14:30:30 -08:00
Chris Masone
eda9b92870 Rename types.TypeRef to types.Type
There are probably still a lot of variable names and comments to fix,
but this updates all the Go code.

Towards #441
2015-11-09 08:26:32 -08:00
Aaron Boodman
69a86f3036 Rewrite walk() to walk value tree instead of chunks
Also fix quad_tree to take advantage of that to be generic again.

Fixes #445, #497
2015-11-05 16:12:02 -08:00
Aaron Boodman
a9bc416a2f Change Chunks() to return []ref.Ref 2015-10-30 09:24:58 -07:00
Erik Arvidsson
ede5f43204 Value should also have a TypeRef
This is so that we can get the runtime type of a value
2015-09-30 16:15:13 -04:00
Aaron Boodman
7944c1b3af Revert "Make WriteValue return a "skinny" copy of input value" 2015-07-30 09:23:35 -07:00
Aaron Boodman
a84893c0d8 Make WriteValue return a "skinny" copy of input value
Fixes #141
2015-07-29 16:06:54 -07:00
Chris Masone
4fe00d4f81 Address aa's comments
- Return factory methods to privacy
- use tighter syntax inside Chunks() methods
- Rename Futures() -> Chunks()
2015-07-23 15:32:38 -07:00
Chris Masone
a560139d73 Make types.future public
This will enable us to walk the chunk graph without having to go
through weird contortions to figure out which values don't have
chunks in any chunkstore (because they were inlined).

Towards issue #82
2015-07-23 15:32:26 -07:00
Aaron Boodman
53003f23f2 Add Value::Ref() 2015-06-12 15:22:27 -07:00
Aaron Boodman
228186dfee Add noms/primitives.go and relatedness 2015-06-02 23:34:51 -07:00