Arrays of one element are now distinguished from values of the same type.
So array polymorphic functions will now work with arrays length 1.

Length 0 isn't supported yet. Tuples of 2 or more values are still
automagically coerced to arrays.

You can make a one element array like:

        array ( 1 )

and of course get the value out in the usual way:

        x . 0

however this may not be sustainable because you can 
also copy an array x like:

        array ( x )

and it now isn't clear if this copies an array or makes a one
element array (whose element just happens to be an array).

Of course you can resolve an ambiguity by specifying the types:

        array[int, 2] (1,2)
        array[ array[int,2],1] (1,2)

but if you don't, it isn't clear to my tiny brain which one would
actually be chosen. Explicitly named functions:

        array_copy
        singleton_array

may be better.

The semantic change is still a bit of a hack .. i.e. I haven't done
a proper theoretical analysis of which isomorphisms can be
implicit or automagic and which need to be explicit.
There are some other complications in the type system I want to
remove first, some of which arose implementing compact
linear types (which isn't yet fully implemented).


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to