On Mon, 11 Jun 2001, Mathieu Bouchard wrote: > On Tue, 12 Jun 2001, Robert Feldt wrote: > > I heartily agree with all of this. In Rockit:examples/ruby there is a > > start at a grammar+ast spec that will fulfill these needs. I'll look > > into your RubyAST (which seems to be more complete) and try to add to > > /comply with that. I'll be back... > Cool. Send me a list of errata when you've got about 14 of them. ;-) First question, in the process of making RubyAST.rb into real runnable ruby code... *** What syntax do you prefer for the following metatypes? *** choice (a set of values): choice foo,bar,baz (current RubyAST,RubyX11) ChoiceType.new foo,bar,baz ChoiceType.of foo,bar,baz ChoiceType[foo,bar,baz] Choice.new foo,bar,baz Choice.of foo,bar,baz Choice[foo,bar,baz] ... union (union of a set of types): foo|bar|baz (current RubyAST) union foo,bar,baz UnionType.new foo,bar,baz UnionType.of foo,bar,baz UnionType[foo,bar,baz] Either.of foo,bar,baz (current RubyX11) ... lists (sequence of elements sharing a same type constraint): Array.of foo (current RubyAST) List.of foo (current RubyX11) ListType.of foo ListType[foo] ... tuples (Struct plus typing): class A; extend AggregateType attr_list [foo,tfoo],[bar,tbar],[baz,tbaz] end (current RubyX11) Struct.of [foo,tfoo],[bar,tbar],[baz,tbaz] tuple [foo,tfoo],[bar,tbar],[baz,tbaz] (current RubyAST) TupleType.of [foo,tfoo],[bar,tbar],[baz,tbaz] The problem is I don't know which syntax is the most "right", and RubyX11's are not necessarily more "right". (Here "right" includes both "convenient" and "consistent") There is not much background of using metatypes in Ruby, you know... (though some people have been talking about "templates") I have some difficulty sorting out (and/or getting comfortable with) subclassing vs metaclassing (vs subtyping vs metatyping...), and also, instanceless vs instanceful; this ends up showing somewhat in the naming (eg: ChoiceType vs Choice...) I'd like naming suggestions to come with rationales and bigger pictures. Such a discussion would benefit both RubyAST and RubyX11. matju