[Grace-core] New version pushed

Andrew P. Black black at cs.pdx.edu
Thu Aug 28 17:49:05 PDT 2014


I just pushed a new version of Minigrace to http://web.cecs.pdx.edu/~grace/minigrace/js/

This is mostly cleanup, implementing a number of the changes that we agreed to on Monday.  Notably, Types now have a ‘methodNames’ method, which answers a set, you so can ask what methods are in a type.  Any object’s mirror also has a method methodNames, which also answers a set.  So, you can see why an object does not have a particular type.  For example:

import "mirrors" as m
def seq = sequence.with(2,3,4)
match (seq)
    case { l:collections.List -> print "{l} is a list — but shouldn't be!" }
    case { s:collections.Sequence -> print "{s} is a sequence" }
    case { _ -> print "we should never get here" }

print "The following list methods are not in sequence:"
def missing = collections.List.methodNames -- m.reflect(seq).methodNames
for (missing.asList.sort) do { 
    each -> print "    {each}"
}


built-in lists are gone, which means that the list that you get back from various built-in methods should actually be real lists.   The variable arity parameter of a variable arity method is now a real sequence.   Done is the Top type, above Object.  

	Andrew






More information about the Grace-core mailing list