[Swift-devel] Updates - Tests

Mihael Hategan hategan at mcs.anl.gov
Sun Jul 24 18:18:56 CDT 2011


This is now in trunk after a few modifications.
What's to be noted about key types (an probably put in some
documentation):
1. Appendable arrays need to be declared like this: a[auto]. "auto" is a
valid type, in that one can do the following:
int[auto] a; a << 1; a << 2;
int[auto] b;
foreach v, k in a {
  auto k2 = k;
  b[k2] = v;
}

2. a[] means a[int].

3. When mapping keys the standard mappers do the following to get the
part of a filename corresponding to a key:
 - for int keys, behave as previously (i.e. use the value)
 - for float keys, use the hex representation of the double value
 - for any other keys, base64(SHA-1(<the string representation of the
object>))

The problem of representing arbitrary-typed keys remains, especially
when stepping out of the primitive area.
------
I've also changed the following:
- the internal representation of an int value now uses java.lang.Integer
as opposed to java.lang.Double.
- arrays can now be declared properly: int[] intArray vs. int
intArray[]. But the old method still works.
- a recursive-descent parser has been added for paths (due to the
complexities of now being able to use floats and strings as keys).

All local tests pass.

So  thanks Yadu!

Mihael

On Wed, 2011-07-20 at 11:39 +0530, Yadu Nand wrote:
> > Great!
> > Please find the patch attached. I see that there are a lot of changes which
> > are actually due to some extra white-spaces (possibly), which will make
> > reading the actual diff a bit difficult.
> My bad, forgot the patch again. :(
> 





More information about the Swift-devel mailing list