[Grace-core] Further questions on the specification

Michael Homer mwh at ecs.vuw.ac.nz
Fri May 13 17:01:27 PDT 2011


Hi,
I have another list of questions about the specification, less focused
than the Unicode questions so they can share a post. Deeper discussion
of any particular point should probably split off to its own thread.
These cover either areas that I found ambiguous in the specification
or points that weren't covered at all.

- Are classes open or closed?
Can a class have methods added to it after declaration? If so, does
that propagate to pre-existing instances? How does it affect the
implicitly-created type?

- Is there any form of mixin or trait?

- Are there short-circuiting operators?
I think they aren't in the specification as it stands, though I've
seen mention of them. The right-hand side would need to be a block so
they will be syntactically a little weird.

- if-then-else
How does elseif work? Is the idea that there is an infinite chain of
if-then-elseif-then-elseif-then-...-else methods? A short chain in the
standard library? Something else? Currently the specification only
uses if-then-else.

- Float64 and equality
There is a Float64 type, and there is built-in equality. How do those
combine? Is equality defined at all on floating-point types? In my
implementation I am currently deferring to the underlying processor's
floating-point, which means equality is nonreflexive.

- MessageNotUnderstood
Is there a feature like this in method dispatch? How does it interact
with static typing?

- for ... each or for ... do
for ... do is in section 6 (Blocks), for ... each in section 10
(Control flow). Is there a distinction, or are they two forms of the
same thing to be settled later?

- Tuple unpacking in method calls
Section 9.1 says "multiple parenthesized arguments are treated as a
single tuple argument". What does that mean? How do you declare a
method that takes this tuple argument, distinguished from one that
really does take one argument?

- Tuples generally
Section 5 says that "(7)" is "the number 7, which is also a 1-tuple
containing 7". Does that mean that all objects support the tuple
interface, or is the type of the expression to be inferred by context?

-Michael


More information about the Grace-core mailing list